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 Quote Link to comment 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"); ?> Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.