PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I know if magic quotes is switched on?


You can find this out with the function
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
}
?>



More forms PHP Questions

How can I check a value entered in a field on my form is a number?
What are magic quotes?
How do I check for an empty field in a form?
How do I remove escape characters from data?
How can I access information sent through GET on a form?