Or, perhaps, you should do: (if register_globals off)
if (!isset($_GET['vw'])){
echo "variable is not set";
}
Of course, you can also do: (if you want to--for some reason)
if ($_GET['vw'] == ""){
write this code
}
- E
PS
> Do all vars in PHP have to be defined first?
No.
>
>M
Matt Zur wrote:
> BUT on the index.php I want to write this if statement:
>
> if ($vw == "") {
> write this code
> }
If you really mean to see if the variable has been set, try this instead:
if (!isset($vw))
{
echo "variable is not set";
}
Happy hacking.
Chris
--
PHP General Mailing
2 matches
Mail list logo