You are here: RE: [PHP] need for $_POST[''] changed after server upgrade « PHP « IT news, forums, messages
RE: [PHP] need for $_POST[''] changed after server upgrade

Posted by "Ray" on 10/08/98 11:34

Hello,
Thanks Matt, I appreciate your help. your solution is a lot easier than mine.
It's also nice to understand what was happening. I was introduced to PHP
after that type of globals were considered 'evil' so I hadn't seen code
written that way.
Ray

-----Original Message-----
From: "Matt Babineau" <matt@criticalcode.com>
To: "'Ray'" <ray@media32.ca>, <php-general@lists.php.net>
Date: Sun, 11 Dec 2005 22:42:46 -0800
Subject: RE: [PHP] need for $_POST[''] changed after server upgrade

> Register globals is no longer ON I believe. That is why it happened.
>
> To fix this:
>
> Foreach($_POST as $key => $value) ${$key} = $value;
>
> That will convert all of your post variables to local variables.
>
> :)
>
>
> Thanks,
>
> Matt Babineau
> Criticalcode
> 858.733.0160
> matt@criticalcode.com
> http://www.criticalcode.com
>
> TAKE ORDERS from the WEB and add them right into QUICKBOOKS! Ask me
> how...
>
>
> > -----Original Message-----
> > From: Ray [mailto:ray@media32.ca]
> > Sent: Sunday, December 11, 2005 10:29 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] need for $_POST[''] changed after server upgrade
> >
> > Hello All,
> > We just upgraded our server at work, and one client's web
> > site stoped working. I didn't write the code, I just get to
> > clean up someone else's mess. :) After a little
> > troubleshooting, I found that forms refered back to the same
> > script. so far, so good. very normal. The strange part was
> > the variable names were just "$foo" not, "$_POST['foo']".
> > After the upgrade, the variable "$foo" was not recognized
> > when the form was processed, so of course, everything failed.
> > My solution was to put if (isset($_POST["foo"]))
> > {$foo=$_POST["foo"]}; at the top of the script. This seems to
> > make everything work.
> > My two questions are: first, is there a better way to fix
> > this, and second, how did this work in the first place?
> > TIA
> > Ray
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To
> > unsubscribe, visit: http://www.php.net/unsub.php
> >
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация