Checking Var's passed via URL
| From: | Saci | Date: | Thu, 08 Aug 2002 18:01:15 +0000 |
| Subject: | Checking Var's passed via URL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111693@lists.php.net to get a copy of this message | ||
Suppose the following code that will be used in 3 different urls calls
<?php
if (isset($_GET['modo'])){
echo "modo seted<BR>";
}
else
{
echo "modo unseted<BR>";
}
if (isset($_GET['key'])) {
echo "key seted<BR>";
}
else
{
echo "key unseted<BR>";
}
?>
If I call with the following url
http://mydomain/Cliente.php?modo=1&key=3741
I receive the following result
modo seted
key seted
When calling with
http://mydomain/Cliente.php?key=3741
I receive
modo unseted
key seted
And when I use
http://mydomain/Cliente.php?modo=1
I get this message
Parse error: parse error, unexpected T_ISSET, expecting '(' in
http://mydomain/Cliente.php on line 2
I'm expecting the following return
modo seted
key unseted
What am'I doing wrong ?