what exactly does this do?

Reply

Join Date: Jun 2005
Posts: 20
Reputation: nike123 is an unknown quantity at this point 
Solved Threads: 0
nike123 nike123 is offline Offline
Newbie Poster

what exactly does this do?

 
0
  #1
Aug 14th, 2005
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);
}
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 193
Reputation: YoungCoder is an unknown quantity at this point 
Solved Threads: 2
YoungCoder's Avatar
YoungCoder YoungCoder is offline Offline
Junior Poster

Re: what exactly does this do?

 
0
  #2
Aug 14th, 2005
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]
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 20
Reputation: nike123 is an unknown quantity at this point 
Solved Threads: 0
nike123 nike123 is offline Offline
Newbie Poster

Re: what exactly does this do?

 
0
  #3
Aug 29th, 2005
sorry am asking this again but, what is the magic_quotes_gpc? magic.... i don't know what it is, and what it does?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 76
Reputation: leelee is an unknown quantity at this point 
Solved Threads: 1
leelee leelee is offline Offline
Junior Poster in Training

Re: what exactly does this do?

 
0
  #4
Aug 30th, 2005
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC