How do I know if magic quotes is switched on?
get_magic_quotes_gpc which will return 1 if the setting is on and 0 if off.
Use it in an if clause to determine what to do with data before entering in a database, like this:
<?php
if (!get_magic_quotes_gpc()) {
$mydata = addslashes($mydata);
} else {
//do nothing: slashes added automatically
}
?>
Comment on this Question and Answer >>>
ASK A QUESTION
More forms PHP Questions
if i send values to database ,but in that table zeros is added ,how can i rectify the errorhow to avoid the refresh or goback to submit the post values in database
How do you check for an empty field in a form?
how to display like table from database records?
Can I use a variable from a .php file to give a value to an HTML FormMail form field thus: ? Thank you
