View Full Version : redirect to page using PHP
01-10-2004, 07:59 PM
Thank you very much
01-10-2004, 08:08 PM
<?php header("Location: http://www.dniwebdesign.ca.tt"); ?>
This should get what you were looking for.
01-10-2004, 08:15 PM
Just fixing up the code above
This must be above any lines of code which output anything to the browser, ie html
01-10-2004, 08:17 PM
That's what I put. What happened to my code?
01-10-2004, 08:22 PM
You forgot to uncheck that checkbox "Automatically parse URLs" beneath the reply textarea.
01-10-2004, 11:46 PM
One of my codingprinciples is "Code once, run forever".
If you want to redirect to another page like you asked
then you can better use the servervariables to automatically fill in the domain and path to the directory. Like
If it's to a page in your site, but in another server, then you can still use the $_SERVER['HTTP_HOST'] , but after that, you need to enter the path, from the sites root on. Like
01-11-2004, 02:46 AM
When i was first using php i had trouble with header location because i failed to learn that you cannot output any html, text, or anything like that before you use header("Location: page.php");
01-11-2004, 03:20 AM
If you are redirection immediately on a page then Header works fine. If you want to do a redirect anywhere else on the page I suggest using meta tags.
<meta http-equiv="refresh" content="15; url=http://www.url.com/file.php?antics=sure">
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.