mark110384 Posted June 24, 2008 Share Posted June 24, 2008 How do u do it? I've got the following header to redirect to the view items page header ('location:viewitems.php?category_selected=$categoryid'); but it displays non of the and the URL has the following http://localhost/example/cart/viewitems.php?category_selected=$categoryid It doesn't seem to find the value? Link to comment https://forums.phpfreaks.com/topic/111662-solved-passing-value-in-header-url/ Share on other sites More sharing options...
kenrbnsn Posted June 24, 2008 Share Posted June 24, 2008 Variables contained in strings delimited by single quotes are not expanded, those in strings delimited by double quotes are. Use either: <?php header ("location:viewitems.php?category_selected=$categoryid"); ?> or <?php header ('location:viewitems.php?category_selected=' . $categoryid); ?> Ken Link to comment https://forums.phpfreaks.com/topic/111662-solved-passing-value-in-header-url/#findComment-573153 Share on other sites More sharing options...
mark110384 Posted June 24, 2008 Author Share Posted June 24, 2008 Found the soloution straight after I posted this. header('location:viewitems.php?category_selected=' .$categoryid); Just incase anyone else is unsure how to do it. Link to comment https://forums.phpfreaks.com/topic/111662-solved-passing-value-in-header-url/#findComment-573154 Share on other sites More sharing options...
mark110384 Posted June 24, 2008 Author Share Posted June 24, 2008 Thanks anyway kenrbnsn Link to comment https://forums.phpfreaks.com/topic/111662-solved-passing-value-in-header-url/#findComment-573155 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.