943,563 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1923
  • PHP RSS
Aug 14th, 2005
0

what exactly does this do?

Expand Post »
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);
}
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nike123 is offline Offline
20 posts
since Jun 2005
Aug 14th, 2005
0

Re: what exactly does this do?

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

Example:
[php]
<?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')";
?>
[/php]
Reputation Points: 13
Solved Threads: 2
Junior Poster
YoungCoder is offline Offline
193 posts
since Aug 2004
Aug 29th, 2005
0

Re: what exactly does this do?

sorry am asking this again but, what is the magic_quotes_gpc? magic.... i don't know what it is, and what it does?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nike123 is offline Offline
20 posts
since Jun 2005
Aug 30th, 2005
0

Re: what exactly does this do?

Reputation Points: 31
Solved Threads: 1
Junior Poster in Training
leelee is offline Offline
76 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: php error HELP!!!
Next Thread in PHP Forum Timeline: file download links script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC