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; Link to comment https://forums.phpfreaks.com/topic/42656-solved-can-you-use-or-statements-in-a-url-get-method/ 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. Link to comment https://forums.phpfreaks.com/topic/42656-solved-can-you-use-or-statements-in-a-url-get-method/#findComment-206945 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 Link to comment https://forums.phpfreaks.com/topic/42656-solved-can-you-use-or-statements-in-a-url-get-method/#findComment-206975 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 Link to comment https://forums.phpfreaks.com/topic/42656-solved-can-you-use-or-statements-in-a-url-get-method/#findComment-206980 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. Link to comment https://forums.phpfreaks.com/topic/42656-solved-can-you-use-or-statements-in-a-url-get-method/#findComment-206992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.