adam291086 Posted October 3, 2007 Share Posted October 3, 2007 i want to run and if statement and if something is true then redirect the user to another page Link to comment https://forums.phpfreaks.com/topic/71693-echo-a-url/ Share on other sites More sharing options...
trq Posted October 3, 2007 Share Posted October 3, 2007 <?php if ($something) { header("Location: http://google.com"); ?> Link to comment https://forums.phpfreaks.com/topic/71693-echo-a-url/#findComment-360904 Share on other sites More sharing options...
shocker-z Posted October 3, 2007 Share Posted October 3, 2007 this must be done at the very top of your code with no white spaces if ($variable) { header("Location: page.php"); } if you are runnign this much further down a page then you would have to look at meta refresh to do this.. Regards Liam Link to comment https://forums.phpfreaks.com/topic/71693-echo-a-url/#findComment-360905 Share on other sites More sharing options...
trq Posted October 3, 2007 Share Posted October 3, 2007 this must be done at the very top of your code with no white spaces Not exactly true. You can't however call the header() function after sending any output to the browser. Link to comment https://forums.phpfreaks.com/topic/71693-echo-a-url/#findComment-360906 Share on other sites More sharing options...
shocker-z Posted October 3, 2007 Share Posted October 3, 2007 sorry thats what i meant.. getting tired and bored, on gardeners leave from work for a month and day time tv scares the hell out of me i sudenly feel like im getting a beer belly watching that stuff! Liam Link to comment https://forums.phpfreaks.com/topic/71693-echo-a-url/#findComment-360911 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.