gotornot Posted December 21, 2010 Share Posted December 21, 2010 Hi I am trying to get all variables passed in a url string and wondered how would i do it? I dont know what they are yet and i need to set key as value. Any help? Link to comment https://forums.phpfreaks.com/topic/222320-getting-any-variables-passed-in-a-url-string/ Share on other sites More sharing options...
Pikachu2000 Posted December 21, 2010 Share Posted December 21, 2010 $_SERVER['QUERY_STRING'] would hold all those values. Link to comment https://forums.phpfreaks.com/topic/222320-getting-any-variables-passed-in-a-url-string/#findComment-1149997 Share on other sites More sharing options...
peterbarone Posted December 21, 2010 Share Posted December 21, 2010 do you mean like this <a href="EDIT.php?id=2">submit id 2</a> then get it from the url on the edit page $id = $_GET['id']; Link to comment https://forums.phpfreaks.com/topic/222320-getting-any-variables-passed-in-a-url-string/#findComment-1150065 Share on other sites More sharing options...
taquitosensei Posted December 21, 2010 Share Posted December 21, 2010 This is a bad idea and a huge security hole. This used to be done automatically. It was called register_globals. They turned it off by default for a reason. You could duplicate it with this. foreach($_GET as $k=>$v) { $$k=$v; } Link to comment https://forums.phpfreaks.com/topic/222320-getting-any-variables-passed-in-a-url-string/#findComment-1150070 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.