ainoy31 Posted June 29, 2007 Share Posted June 29, 2007 Here is my scenario: I am passing my variables via the URL from page to page. This is base on dealing with Authorize.Net. However, here is my question. Can I do the following: $x = $_REQUEST['amount']; and then pass the $x via the url to another page like https://xxx.com/natHealing/view_gift.php?x Much appreciation Link to comment https://forums.phpfreaks.com/topic/57776-passing-variables-via-url/ Share on other sites More sharing options...
per1os Posted June 29, 2007 Share Posted June 29, 2007 <?php //$x = $_REQUEST['amount']; and then pass the $x via the url to another page like https://xxx.com/natHealing/view_gift.php?x $x = $_REQUEST['amount']; $url = "http://www.site.com/page.php?x=" . url_encode($_REQUEST['amount']); ?> Would work. Link to comment https://forums.phpfreaks.com/topic/57776-passing-variables-via-url/#findComment-286170 Share on other sites More sharing options...
clanstyles Posted June 29, 2007 Share Posted June 29, 2007 Why do you use url_encode ? Link to comment https://forums.phpfreaks.com/topic/57776-passing-variables-via-url/#findComment-286180 Share on other sites More sharing options...
per1os Posted June 29, 2007 Share Posted June 29, 2007 It makes variables url friendly, as an & inside $_REQUEST would throw the url off, url_encode encodes them so they can be passed as they need to be passed. Link to comment https://forums.phpfreaks.com/topic/57776-passing-variables-via-url/#findComment-286184 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.