Cep Posted March 14, 2007 Share Posted March 14, 2007 Just wondering if it is possible to use an OR statment within a url that is processed by the GET method? How could you change this for example to be groupid 10 OR 1? www.myscript.com/index.php?groupid=10&groupid=1; Quote Link to comment Share on other sites More sharing options...
mjlogan Posted March 14, 2007 Share Posted March 14, 2007 PHP will only see groupid=1 groupid=10 will be ignored print_r($_GET); at the top of the page and you will see what variables are available. Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 14, 2007 Share Posted March 14, 2007 page.php?group=1,2,3,4 will work, then: $groups = explode( $_GET['group'] ); also check out implode(); monk.e.boy Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 14, 2007 Share Posted March 14, 2007 You can use arrays in the URL to get multiple values: www.myscript.com/index.php?groupid[]=10&groupid[]=1 Your processing script would then see an array of two elements: Array ( [0] => 10 [1] => 1 ) Ken Quote Link to comment Share on other sites More sharing options...
Cep Posted March 14, 2007 Author Share Posted March 14, 2007 Thanks for your help peeps I knew there must be a way. Quote Link to comment 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.