Computing.Net > Forums > Web Development > Error in PHP Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Error in PHP Script

Reply to Message Icon

Name: RTAdams89
Date: March 23, 2006 at 08:06:33 Pacific
OS: xp home
CPU/Ram: na
Product: na
Comment:

Hello all. I've finally got my photo gallery up and running. I've verified that it does in fact work, but today I noticed a bunch of errors in my system event log. They all say the same thing which is:
"The description for Event ID ( 2 ) in Source ( PHP-5.1.2 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: php[3032], PHP Warning: Invalid argument supplied for foreach() in E:\baseball\gallery\photos.php on line 50."

I have no idea about the first half of that message, but the last part about the error on line 50 is worrying me. I know very little about PHP, but I do know the script works, so I don't get how there can be an error there. Anyhow, the code from line 49-53 is:
"
// in case register global is off
foreach($HTTP_GET_VARS as $key => $val) {
$$key = $val;
global $$key;
}
"

And the rest of the file can be viewed at http://rtadams89.dyndns.org:9555/web.zip

Can someone tell me what the problem is?

-Ryan Adams
http://members.cox.net/rtadams89/



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: March 23, 2006 at 10:26:33 Pacific
Reply:

A quick google check brought up several posts suggesting that you have to make sure that "Reigster globals = On" in the php.ini file.

Michael J


0

Response Number 2
Name: RTAdams89
Date: March 23, 2006 at 12:00:50 Pacific
Reply:

It is on.

-Ryan Adams
http://members.cox.net/rtadams89/


0

Response Number 3
Name: RTAdams89
Date: March 25, 2006 at 19:19:12 Pacific
Reply:

It seams that the "foreach()" function was dealing with an $HTTP_GET_VARS. The new variable which has replaced it in the latest version of PHP is just $_GET. By replacing the $HTTP_GET_VARS with the new $_GET, the problem was solved.

-Ryan Adams
http://members.cox.net/rtadams89/


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Error in PHP Script

mysql_numrows() error in php www.computing.net/answers/webdevel/mysqlnumrows-error-in-php/770.html

error in php www.computing.net/answers/webdevel/error-in-php/3595.html

enable error reporting in PHP www.computing.net/answers/webdevel/enable-error-reporting-in-php/341.html