Are magic quotes on?

by Keiron on February 28, 2007

One way to check if magic_quotes is running is to run get_magic_quotes_gpc(). It will return a 1 if it is on, or a 0 if it is off. You can use this result to print out the magic_quotes status, or to decided if you should run another function, such as addslashes.

< ?php
if (get_magic_quotes_gpc()==1)
{
Print “Magic Quotes gpc is turned on” ;
}
else
{
Print “Magic Quotes gpc is turned off” ;
}
?>

Tag Me:
  • Digg
  • del.icio.us
  • Furl
  • StumbleUpon
  • Technorati
  • Sphinn
  • TwitThis

{ 0 comments… add one now }

There are no comments yet...

Kick things off by filling out the form below ↓

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Wall Plugs!