View Full Version : write to database and go to url problem

11-11-2006, 09:06 PM
I have a php script which will write data entered from a form into a database table.

However, what I want the script to do is to write the data and then goto a new webpage.

Does anyone know the code to finish the script and allow the new page to be loaded into the browser?


11-11-2006, 09:31 PM
// do database stuff

// this will send the user to example.com
header("Location: http://example.com");

make sure theres no output at all on the page otherwise you will get "header already sent" errors

output includes whitespace before or after the <?php and ?>