Asperon Posted November 9, 2007 Share Posted November 9, 2007 is it possible to send data via location header like so <?php $search = 'random'; $location = 'mysite.com/myfile.php?search='.$search; // mysite.com/myfile.php?search=random header('Location: $location'); ?> Thank You Quote Link to comment https://forums.phpfreaks.com/topic/76617-location-header-question/ Share on other sites More sharing options...
Asperon Posted November 9, 2007 Author Share Posted November 9, 2007 there was an error so I resubmit, sorry for the duplicate stay with this one Quote Link to comment https://forums.phpfreaks.com/topic/76617-location-header-question/#findComment-387954 Share on other sites More sharing options...
revraz Posted November 9, 2007 Share Posted November 9, 2007 Use double quotes instead of single and try it. Quote Link to comment https://forums.phpfreaks.com/topic/76617-location-header-question/#findComment-387967 Share on other sites More sharing options...
GingerRobot Posted November 9, 2007 Share Posted November 9, 2007 As in, use the double quptes inside the header function: <?php $search = 'random'; $location = 'mysite.com/myfile.php?search='.$search; // mysite.com/myfile.php?search=random header("Location: $location"); ?> Strings inside single quotes are treated as literals: you are litterally trying to send the browser to $location - not the value of $location. Quote Link to comment https://forums.phpfreaks.com/topic/76617-location-header-question/#findComment-387987 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.