hi there, i am new to all this web design stuff and i got a question regarding redirecting the page once an email form is sent to me

in my php i have a form set up to send me information that people type down and it emails it to me once its sent, what i need to know is how to then redirect the page to my paypal checkout page once they send the form email?

thanks

Place this line after your mail function

echo '<script language="javascript">window.location.href="thanku.htm";</script>';

I would rather user php's header function. Thats because, if the user has disabled javascript, javascript redirection fails.

header("location: somepage.php");

yes naveen..
but i got error like headers already sent by using header...
why like this...
plz reply me....

You are not supposed to have an echo, any html tag or even a whitespace if you are using header function. You should make sure that no output is sent to the browser before calling header function. You can use ob_start() to start output buffering (and hence avoid this error).

thanks naveen...
by next time , i will follow your indication...

:) You are welcome!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.