pequeño problema localhost apache

i have small problem with apache

apache is automatic securing my varibales!

ejemplo

echo $_GET['id'];

link: http://localhost/file.php?id=sadsad'sadad'asd

it's output sadsad\'sadad\'asd

How i can disable this thing ?

preguntado el 27 de agosto de 11 a las 22:08

i have edited files and still getting \' may be i should restart apache! if so , how i can restart! -

2 Respuestas

You are probably seeing the effects of Cotizaciones de magia. This is a PHP feature, not an Apache feature. And you should disable it immediately, because it's stupid.

To disable, follow the link above, and you'll end up on the Disabling Magic Quotes page. As it says there, you'll need to edit your php.ini file, thus:

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off

Respondido 28 ago 11, 14:08

@Osama: Did you read the link I provided? Oh well, I've updated my answer. - Oliver Charlesworth

Puedes usar stripslashes to get rid of the problem:

$id=$_GET['id'];
if (get_magic_quotes_gpc()) {
    $id=stripslashes($id);
}
echo $id;

Respondido 28 ago 11, 03:08

Or better yet, turn off MagicQuotes since it's deprecated and won't be supported in the future. - ldg

No , i want only disable the magic quates from settings without using php functions! - Osama Tarek

i have edited files and still getting \' may be i should restart apache! if so , how i can restart! <- sorry this replay for the answer of Oli Charlesworth - Osama Tarek

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.