hatrickpatrick Posted August 17, 2007 Share Posted August 17, 2007 In my script, there are a few variables I want passed from one page to another, and rather than do the long winded "if isset" method for all of the links on the page, I've heard there is a global variable which basically puts them all into the ?var1=value&var2=value etc format... Anyone know which variable that is? PHP_SELF only passes the filename... Link to comment https://forums.phpfreaks.com/topic/65479-how-to-pass-all-get-variables-using-php_self/ Share on other sites More sharing options...
wildteen88 Posted August 17, 2007 Share Posted August 17, 2007 You'll probably want to look at $_SERVER['QUERY_STRING']. This variable holds all the query strings being passed to the page: echo $_SERVER['PHP_SELF'] . '? ' . $_SERVER['QUERY_STRING'] ; Link to comment https://forums.phpfreaks.com/topic/65479-how-to-pass-all-get-variables-using-php_self/#findComment-326933 Share on other sites More sharing options...
hatrickpatrick Posted August 17, 2007 Author Share Posted August 17, 2007 Excellent, that works - just one more problem, is there a variable which gives you JUST the filename? PHP_SELF gives ou the directory as well... Link to comment https://forums.phpfreaks.com/topic/65479-how-to-pass-all-get-variables-using-php_self/#findComment-326995 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.