Jump to content

Help With Old PHP Code


amin1982

Recommended Posts

Hey Guys,

 

Some help needed please! I'm currently maintaining a website for a client however the site was written a while ago and is in PHP3 I believe. I have recently moved the site on my server which uses PHP 5. The site works ok however one feature on the site is having a back end which allows the user to login and add news, update, delete data... basically a custom content management system.

 

The only problem however is when we click on submit to update a page or news item the page goes white and nothing is saved.

 

The error logs show just one error which is:

 

[Wed Jul 25 14:56:00 2007] [error] [client 81.201.136.69] PHP Warning: Invalid argument supplied for foreach() in /home/bbwebmaster/public_html/administer/list.php on line 248, referer:

 

The code which this is talking about is:

 

if ($addentry)
$qry = "insert into ".$page." set ";

$first = "yes";
foreach ($HTTP_POST_VARS as $postvar_key => //**LINE 248**//
$postvar_value) {
if (($postvar_key != 'Submit_x') && ($postvar_key != 'Submit_y')) {
if ($first == "no")
$qry .= ",";
$qry .= $postvar_key."='".$postvar_value."'";
$first = "no";
}
}

 

 

I'm hoping that if I can fix this then the script will work... either that or downgrade my server to PHP3 OR 4 which I dont wish to do.

 

If you can suggest anything please let me know.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/61693-help-with-old-php-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.