|
Posted by SOR on 11/15/52 11:22
<comp.lang.php , Tony Marston , tony@NOSPAM.demon.co.uk>
<dc7il1$gsd$1$8300dec7@news.demon.co.uk>
<Wed, 27 Jul 2005 10:03:28 +0100>
> > Thanks for that , Glad magic quotes where switched on or it probably
> > would have been the first bug report in a few days times when I make a
> > script public .
> >
> > Seem to recall a while ago some geeks on another newsgroup saying magic
> > quotes was a bad thing though .
>
> It can be if you write a script in an environment where it is turned on,
> then try to run it in another environment where it is turned off. Ideally
> you should write code which can detect whether it is ON or OFF and deal with
> it as appropriate, such as:
>
> if (!get_magic_quotes_gpc()) {
> $lastname = addslashes($_POST['lastname']);
> } else {
> $lastname = $_POST['lastname'];
> } // if
>
Saved to disk .
At the risk of being pointed to www.php.net by andy - would you have a
similar code snippet to check and see if globals is switched on .
Navigation:
[Reply to this message]
|