You are here: Re: Multiple submits broken in PHP5 « PHP Programming Language « IT news, forums, messages
Re: Multiple submits broken in PHP5

Posted by ECRIA Public Mail Buffer on 05/26/05 20:57

It should be noted that this is not an issue of PHP 4 versus 5, but rather
of different configurations (php.ini files).

You are able to access $ok and $cancel because they are automatically set as
global variables in your PHP 4 config. You should disable this - only
goodwill can stop me from submitting a form with a field called "query" set
to drop all your databases...

To do so, open your php.ini file (probably located in your PHP folder or
your Windows folder - on Windows) and change the line that reads:

register_globals = On

to

register_globals = Off

Now, you not be able to access $ok or $cancel directly - instead, you can
access them through the $_GET or $_POST arrays(depending on your form
method). For example, if your form method is POST, then you can use this:

if (isset($_POST["ok"])) { something } and if (isset($_POST["$cancel"]))
{ something else }

ECRIA
http://www.ecria.com

 

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

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