akurtula Posted October 30, 2010 Report Posted October 30, 2010 (edited) hi I am wondering if there is way of checking if a query string exists (without any other string) for example: http://site.com?value=string&value2=string i can check if the string exits: if($_GET[value] == true && $_GET[value2] == false){ //perfect } however, there are a lot of combinations where "value" strings apears. so is there a way of checking if ONLY one string exists? hope you can help thanks Edited October 30, 2010 by akurtula Quote
falkencreative Posted November 1, 2010 Report Posted November 1, 2010 Seems like you could do this by counting the number of items in the $_GET array. For example: if (isset($_GET['value']) && count($_GET) == 1) { // continue } Quote
akurtula Posted November 3, 2010 Author Report Posted November 3, 2010 thanks a lot thats really helpful and easier to understand than some other solutions at the php manual Quote
mithunsingh Posted November 13, 2010 Report Posted November 13, 2010 (edited) I have tried checking Request["foo"] as well as Request.QueryString["foo"] and I get null for both. I have also tried populating a List with the values from the QueryString collection but as I mention below, it does not include the value. Edited November 13, 2010 by falkencreative Link Deleted - No Spam Please (and, btw, 'professional' is spelled with ONE f, only) Quote
falkencreative Posted November 13, 2010 Report Posted November 13, 2010 @Mithun What language are you using? That looks like ASP, and we are talking about PHP in this thread. It's quite possible that you won't be able to use a PHP way of doing things with ASP code. Quote
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.
Note: Your post will require moderator approval before it will be visible.