header is the appropriate one you're looking for: header( "Location: thanks.php" );
what i do is use the page that processes all the data to also validate the data. if the data does not pass through, it stays on this page with all the errors listed in the body. if it goes through.. then the 'header()' is loaded. example. page1 <form action="send-form.php" method=post> all the stuff in your form. i.e. email:<br> <input type="text" name="Email" size="30"> </form> ...................................................................... page2 (send-form.php) <?php $from = "$Email"; $from = "From: $from"; $headers = "$from\n"; $emailto ="[EMAIL PROTECTED]"; $exclude = array( "Submit_x", "Submit_y", "submit" ); $title ="custom title - $Title"; $message = "\n"; $message .= "-----------\n"; $message .= "This information was sent on ".date('dS of F Y (H:i)')."from Netdiver.\n"; $message .= "-----------\n"; $message .= "Email: $Email\n"; function checkemail( $Email ) { $regexp = "/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/"; if( !preg_match( $regexp, $Email ) ) return false; return true; } $emailOK = checkemail( $Email ); if ($emailOK == true ){ // echo $message; header( "Location: thanks.php" ); mail( $emailto, $title, $message, $headers ); exit( ); } ?> <html> <head> <title>Error!! Form not filled properly.</title> </head> <body> you need to enter a valid email address </body> </html> .................................. page 3 (thanks.php) <html> <head> <title>thanks</title> </head> <body> Thanks! </body> </html> ................................................................. hope this helps wes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php