phpretard Posted April 19, 2008 Share Posted April 19, 2008 $event=$_GET['event']; header( 'Location: http://www.website.com/index.php?page=checkout&event=$event' ); The redirect works but the address bar reads: http://www.website.com/index.php?page=checkout&event=$event' <---should be event=Sports I need the $event. It work throughout the site exept when a header redirect is used. Any thought? Link to comment https://forums.phpfreaks.com/topic/101873-solved-passing-variable-thourgh-header-redirect/ Share on other sites More sharing options...
chigley Posted April 19, 2008 Share Posted April 19, 2008 <?php $event = $_GET['event']; header("Location: http://www.website.com/index.php?page=checkout&event={$event}"); ?> Use double quotes when using variables inside them. I also added {} to make doubly sure Link to comment https://forums.phpfreaks.com/topic/101873-solved-passing-variable-thourgh-header-redirect/#findComment-521384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.