php newbie question
- Started
- Last post
- 5 Responses
- smartK
I have this php-file that processes an e-mail form, now I want to specify a html site it should redirect to, when the "submit" button is clicked.
what's the php code for redirecting?
- motivdesign0
Before you send any HTML to the browser, you'll need to use a header(); function in the form:
header('location: http://blahblah.com');
Also, I don't think this will work if you're using sessions to store variables, since the server can only send header information once and the session id requires a cookie header to be sent.
If nothing else, you could always spit out a javascript window.location redirect to the page in html once the mail is sent off.
- motivdesign0
To clarify, when I said "in the form" in the first paragraph above, i didn't mean literally IN an html form, but more as "in the form of: "
- smartK0
it's always the same URL, just a "thanks for submitting" site ...
- smokie0
Header("Location: http://123.456.com");
- smartK0
works fine, thanks a lot smokie!