Jump to content

[SOLVED] Check get isset


EchoFool

Recommended Posts

Is it possible to get check $_GET is set regardless of what type of $_GET is set?

 

So say theres like 10 $_GET urls on one page. Rather than checking one at a time like this:@

 

 if (isset($_GET['test']) OR isset($_GET['test'])) 

 

Is there a way to just do if(isset($_GET['wildcard']))

 

So the wild is to check for anything? =/ Would help shorten my script quite a lot lol :P

Link to comment
Share on other sites

eep error in mine.

 

<?php

$get = count($_GET);

if($get > 0){
foreach($_GET as $name => $value){
	echo $name . " has the value of " . $value . "<br>\n";
}
}else {
echo "There are no valid get parameters in the URL!";
}

?>

 

when my url looks like: http://localhost/test/get.php?1=2&3=4&5=6

 

my results:

 

1 has the value of 2
3 has the value of 4
5 has the value of 6

 

when my url looks like: http://localhost/test/get.php

 

my results:

 

There are no valid get parameters in the URL!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.