Page 1 of 1

question about page redirection or reload

Posted: Sun Mar 22, 2009 8:45 pm
by greedyisg00d
Hi I am just a bit confused of what us the best way to reload or redirect a page in php. Usually I used header function for example

Code: Select all

header('location:schedulelist.php');
My next question is it needed to include the full url of the page for example http://localhost/schedulelist/login.php or I can just use the page url only which is schedulelist.php.

The reason why I am asking is that I am currently testing through localhost and since the domain name will be change upon deployment, I do not want my visitors to encounter broken links in navigating my page.

Thanks

Re: question about page redirection or reload

Posted: Sun Mar 22, 2009 9:20 pm
by Benjamin
Yes, you do need to use the complete URL. You can however define it in a constant, so that it only needs to be changed in one place for production.