You are here: Re: variable problem in address book script « All PHP « IT news, forums, messages
Re: variable problem in address book script

Posted by Geoff Berrow on 01/01/07 11:54

Message-ID: <PcednbE3mYMMbQXYnZ2dnUVZ_tunnZ2d@adelphia.com> from Mr.
Newt contained the following:

>I'm new to PHP and found a script on about.com that is supposed to make an
>address book. Doesn't work (for me) though. First thing I noticed is that
>a variable ($mode) is not declared. When I do declare it, the script still
>doesn't work properly.

Older versions of PHP used to register globals automatically This means
that if you wrote a URL like this
www.example.com?name=Fred&email=fred@example.com

Then the variables $name and $email would be created automatically with
values 'Fred' and 'fred@example.com' respectively.

This poses security risks and so modern versions of PHP have register
globals turned off.

To save you rewriting your script, add the following right after your
database connection string. Note: this is NOT good practice but simply
a way of getting you going.

foreach($_GET as $key=>$value){
$$key=$value;
}

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 

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

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