0

:?: Have tried to make sense of this, but am not quite sure what this !get_magic_quotes_pgc does, can someone please provide me with a simple expalnation of what it is, and why do i really need it. Please please please. Thanks. :lol:

if(!get_magic_quotes_gpc())
{
$title = addslashes($title);
$content = addslashes($content);
}

3
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by leelee
0

It returns the current configuration setting of magic_quotes_gpc (0 for off, 1 for on).

Example:

<?php
echo get_magic_quotes_gpc();        // 1
echo $_POST['lastname'];            // O\'reilly
echo addslashes($_POST['lastname']); // O\\\'reilly

if (!get_magic_quotes_gpc()) {
   $lastname = addslashes($_POST['lastname']);
} else {
   $lastname = $_POST['lastname'];
}

echo $lastname; // O\'reilly
$sql = "INSERT INTO lastnames (lastname) VALUES ('$lastname')";
?>
0

sorry am asking this again but, what is the magic_quotes_gpc? magic.... i don't know what it is, and what it does?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.