runnerjp Posted July 17, 2009 Share Posted July 17, 2009 how comes my redirect echos out index.php?page=message&forum=$forum&id=$forumpostid&pagenum=last and not the php output... well i cant think of the word lol but the output of $forum is what i mean lol minds gone blank header('Location: index.php?page=message&forum=$forum&id=$forumpostid&pagenum=last'); Quote Link to comment Share on other sites More sharing options...
ldougherty Posted July 17, 2009 Share Posted July 17, 2009 The loaction header must contain an absolute URI!! See note above "Note: HTTP/1.1 requires an absolute URI as argument to » Location". Thus: <?php header("Location: /home.php"); ?> is wrong, but most browsers will follow it correctly (hence the common mistake). This is correct: <?php header("Status: 301"); # 301 Moved Permanently header("Location: http://{$_SERVER['SERVER_NAME']}/home.php"); exit; ?> Quote Link to comment Share on other sites More sharing options...
phporcaffeine Posted July 17, 2009 Share Posted July 17, 2009 You are trying to iterate variable values inside single quotes. Either use double quotes or concatenate it. header('Location: http://mydomain.com/index.php?page=message&forum=$forum&id=$forumpostid&pagenum=last'); SHOULD/COULD BE header('Location: http://mydomain.com/index.php?page=message&forum=' . $forum . '&id=' . $forumpostid . '&pagenum=last'); OR header("Location: http://mydomain.com/index.php?page=message&forum=$forum&id=$forumpostid&pagenum=last"); 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.