This is probably a very simple question, but how do I get another web page using php?
I have some code that executes some logic, and needs to get back to index.php when its done.
Are there any simple functions?
Changing URL
Moderator: General Moderators
Re: Changing URL
You want to redirect?
Code: Select all
header('Location: index.php')-
roadkillguy
- Forum Newbie
- Posts: 7
- Joined: Sun Feb 22, 2009 11:26 am
Re: Changing URL
That doesn't seem to work. It gives a warning stating that php cant modify the header information because it was already sent.
Warning: Cannot modify header information - headers already sent by (output started at /home/david/public_html/PHP/Test.php:3) in /home/david/public_html/PHP/Test.php on line 19
Warning: Cannot modify header information - headers already sent by (output started at /home/david/public_html/PHP/Test.php:3) in /home/david/public_html/PHP/Test.php on line 19
Re: Changing URL
that statement has to be at the top of the page before any output (including html). Or you could use ob_start() I hear.