jlove Posted June 2, 2006 Share Posted June 2, 2006 This is a simple question but it puzzles me.. If it pass a variable without the variable name ike this :[code]page.php?hello[/code]How do I catch tat in the PHP code? I've tried $_REQUEST[''] but that doesn't seem to work... Quote Link to comment https://forums.phpfreaks.com/topic/11021-passing-a-get-variable-without-the-variable-name/ Share on other sites More sharing options...
ysu Posted June 2, 2006 Share Posted June 2, 2006 [!--quoteo(post=379314:date=Jun 2 2006, 11:12 PM:name=jlove)--][div class=\'quotetop\']QUOTE(jlove @ Jun 2 2006, 11:12 PM) [snapback]379314[/snapback][/div][div class=\'quotemain\'][!--quotec--]This is a simple question but it puzzles me.. If it pass a variable without the variable name ike this :[code]page.php?hello[/code]How do I catch tat in the PHP code? I've tried $_REQUEST[''] but that doesn't seem to work...[/quote]It's not a variable without name, it's a variable without value.try to echo all $_GET values, or simply var_dump($_GET) to see what I mean Quote Link to comment https://forums.phpfreaks.com/topic/11021-passing-a-get-variable-without-the-variable-name/#findComment-41154 Share on other sites More sharing options...
asylum Posted June 3, 2006 Share Posted June 3, 2006 $_SERVER['QUERY_STRING']that will get the query string as an actual string so you can simply pass a value without a variable name. Quote Link to comment https://forums.phpfreaks.com/topic/11021-passing-a-get-variable-without-the-variable-name/#findComment-41361 Share on other sites More sharing options...
wildteen88 Posted June 3, 2006 Share Posted June 3, 2006 Your best of looking into mod_rewrite instead. Its much easier.What mod_rewrite can do is change the following url:mysite.com/page.php?var1=hello&var2=worldinto something like this:mysite.com/page/hello/worlda friendly URL Quote Link to comment https://forums.phpfreaks.com/topic/11021-passing-a-get-variable-without-the-variable-name/#findComment-41434 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.