npsari Posted June 22, 2007 Share Posted June 22, 2007 Hi I am using this simple redirection php code in my site <?php header( 'Location: http://example.com?Friend=$ID' ) ; ?> I want the ID to alter... however, when i type in the browser: http://www.mysite.com?ID=5 The redirect code doesnt take me to http://example.com?Friend=5 It still takes me to http://example.com?Friend=$ID therefore, an error Why it doesnt read the variable How can i fix this Link to comment https://forums.phpfreaks.com/topic/56762-solved-a-mini-redirection-problem-support-please/ Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 header("Location: http://www.example.com?friend={$_GET["ID"]}"); Link to comment https://forums.phpfreaks.com/topic/56762-solved-a-mini-redirection-problem-support-please/#findComment-280316 Share on other sites More sharing options...
pocobueno1388 Posted June 22, 2007 Share Posted June 22, 2007 You need to use double quotes: <?php header("Location: http://example.com?Friend=$ID") ; ?> Link to comment https://forums.phpfreaks.com/topic/56762-solved-a-mini-redirection-problem-support-please/#findComment-280319 Share on other sites More sharing options...
npsari Posted June 22, 2007 Author Share Posted June 22, 2007 THANKS AMIGOS PROBLEM SOLVED Link to comment https://forums.phpfreaks.com/topic/56762-solved-a-mini-redirection-problem-support-please/#findComment-280324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.