Hello all,
I'm very new to PHP. I have studied the manual but I can't find the function that I need. How do I make the browser go to a specific page (or URL)? To be more precise, I want to do the following. I have page1.php with a form, that goes to page2.php when the submit button is pressed. In page2.php the script adds a record to a MySQL database. I then want it to return to page1.php when it's finished. How do I do that?
Please tell me if you want me to supply the code.
Thanks in advance,
Jerome Smith
How to go to a URL
Moderator: General Moderators
Yeah it's not too obvious, but it is quite simple...
It must be at the top and html headers will most likely cause errors if mixed with this.
Code: Select all
<?php
Header ("Location: url.php");
?>Error Message
Hi Sami,
Thanks. Yes I tried that, and I got the following error message:
Warning: Cannot modify header information - headers already sent by (output started at /home/ftp/uploads/pruebas/FormIdiomaPrg23.php:4) in /home/ftp/uploads/pruebas/FormIdiomaPrg23.php on line 15
I would be really grateful if you can help me with this.
Jerome
Thanks. Yes I tried that, and I got the following error message:
Warning: Cannot modify header information - headers already sent by (output started at /home/ftp/uploads/pruebas/FormIdiomaPrg23.php:4) in /home/ftp/uploads/pruebas/FormIdiomaPrg23.php on line 15
I would be really grateful if you can help me with this.
Jerome