Reply to Re: Code stoped working after upgrading from 4 to 5

Your name:

Reply:


Posted by M. Sokolewicz on 04/28/05 13:43

Mário Gamito wrote:
> Hi,
>
> I have this simple piece of code that worked like a chram in PHP 4.x
> Now that i've moved to PHP 5 it doesn't work anymore.
> I always get 0 for $form_ok even if all fields are filled.
>
> The variables come from a form in a previous page.
>
> Any ideas on where the problem might be ?
> I have "register_globals = Off" in php.ini
>
> Any help would be apreciated.
>
>
> // test if all fields were filled
> if (($email == '') || ($name == '') || ($pass == '') || ($pass2 == '')
> || ($magic_number == '') || ($answer == ''))
> $form_ok = 0;
>
>
> Warm Regards,
you've said it yourself already, you have register_globals OFF, while
your code only works with register_globals ON.

This url might help you:
http://www.php.net/manual/en/security.globals.php

To "fix" your code, you'd need to make sure that you call upon the
$_GET/$_POST/$_REQUEST values instead of the (supposedly) derived
variables $mail, $name, $pass, etc. Since those don't exist anymore
after turning OFF register_globals.

- tul

[Back to original 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

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