|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
php errors
This is driving me nuts. I'm getting a local error for coding that tests fine online.
Notice: Undefined variable: inc in D:\ActiveWebfiles\AxwoodWebsite\SecretSantaFiles\index.php on line 27 Line 27 says Code:
if (!$inc) { include("Home.htm"); }
Is this stupid or what?! Help! I'm running IIS and php 5.0 build 2195 on a Win2000 system. And before somebody says "url must have http://localhost", I get the same using this url. http://localhost/AxwoodWebsite/SecretSantaFiles/index.php produces "Notice: Undefined variable: inc in D:\ActiveWebfiles\AxwoodWebsite\SecretSantaFiles\index.php on line 27" Thanks. HeadElf
__________________
HeadElf OfficeElf.com Last edited by HeadElf : October 29th, 2005 at 12:29 AM. |
|
#2
|
|||
|
|||
|
This question doesn't have anything to do with IIS, maybe try the PHP forum if you don't get a solution.
My guess, perhaps $inc isn't present.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
Trust me, $inc DOES exist in the programming and it is very definately NOT a php problem. The script works great on the online web server, and without issue. On my local system, with the above configuration, not only will the server not do page to page navigation (<a href="index.php?inc=4">), it won't hold the variable content nor recognize session variables. It's something in the setup, I just can't figure what.
I'm testing a new editor that's supposed to be so much better (still reserving opinion until I can get the server/php on my local machine working correctly). Until now, I've simply moved the files to the online server and tested them there. For this configuration/testing bit, I'm using already proven scripts so I know there are no errors produced by the script. HeadElf |
|
#4
|
||||
|
||||
|
Quote:
It might be caused by servers configured differently. The error you're getting is just a notice, not an error. In php.ini there is an error_reporting variable. If you set this to: error_reporting = E_ALL & ~E_NOTICE you'll be shown all errors except for notices (which is the message you're currently getting). This is probably how your online server is configured. |
|
#5
|
||||
|
||||
|
As Ed & Doug said - this is a php issue.
What's happening is that you're trying to use $inc before setting it (i.e. undefined variable inc ) in the line if (!$inc) { include("Home.htm"); }. However since $inc doesn't exist, !$inc is true, and you end up include'ing Home.htm. These types of warnings are generally hidden by setting the error-reporting level as edwin mentioned ( which is why you're not getting that error on your other server ), but it's far better practice to use something like: PHP Code:
--Simon
__________________
|
|
#6
|
||||
|
||||
|
Thanks for the feedback, guys.
I'm actually not accessing the variable in the line of code mentioned, just checking to see if it exists. And, if I click any of the other menu items which DOES set the variable, the variable isn't set, so no other page comes up, just the homepage. This setup works perfectly online (it's there and working fine now!) so it's got to be something in the php setup. I just don't know enough to go find it. Thanks again. HeadElf |
![]() |
| Viewing: Dev Shed Forums > System Administration > IIS > php errors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|