I'm just starting to learn php and have a quick question. I'm making a
site with file includes. so for example my default page will be:
index.php and services page with be called services.php
BUT... I want to link to services via this method: index.php?vw=services
Still no problem there.
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 List
AM
To: [EMAIL PROTECTED]
Subject: [PHP] newbie... - undefined var
I'm just starting to learn php and have a quick question. I'm making a
site with file includes. so for example my default page will be:
index.php and services page with be called services.php
BUT... I want to link
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.
4 matches
Mail list logo