|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Undefined Variable in PHP problem.
i know there's another article on this but this one is slightly different as mine doesn't involve database.
my code looks like the one below. Code:
<?
if($id=='' || $id=='home')
{
include ("home.php");
}
?>
this code is the only PHP code on the page. but it keeps giving me "Notice: Undefined variable: id in c:\program files\apache group\apache\htdocs\index.php on line XX" code on anywhere that has that code. it works normal with PHP 4.0.2 but the error message appears when using PHP 4.2.3 please do help. Last edited by goldfries : December 23rd, 2002 at 09:32 PM. |
|
#2
|
|||
|
|||
|
try
if isset($id) { } Cheers Jayesh Jain
__________________
Cheers Jayesh Jain |
|
#3
|
|||
|
|||
|
oh ok.
Parse error: parse error, unexpected T_ISSET, expecting '(' in c:\program files\apache group\apache\htdocs\aquaria\index.php on line 25 hrmrmr...........going to try to figure it out. |
|
#4
|
|||
|
|||
|
Try this.
Code:
if(isset($id)) {
}
|
|
#5
|
|||
|
|||
|
also if you are using the newer PHPs you should really be using $_GET['id'] instead of just $id
(thats if you are reading it from the URL) bramp |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Undefined Variable in PHP problem. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|