http://ie.php.net/manual/en/function.get-magic-quotes-gpc.php

use stripslashes() :

<?php
    echo stripslashes(urldecode($_GET["strSQL"]));
?>

Cheers



"Victor spång arthursson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Perhaps I'm tired, perhaps I've missed something obvious, but I can't
get this simple thing which I practically does every week to work…

Ok, here is what I do:

<?php

$foo = urlencode("Delete from whatever where ditten = 'datten'");
echo '<a href="foo.php?strSQL=' . $foo . '">Click here to test</a>';

?>

I sidan foo.php skriver jag:

<?php

echo urldecode($_GET["strSQL"]);

?>

and gets the result:

Delete from whatever where ditten = \'datten\'

The question is why PHP escapes the single qoutes? This has never
happened to me before, except if I have been using addslashes() or
similiar functions…

And they occur even if I don't urlencode at all…

Why!?!?!?!?

Sincerely

Victor Spång Arthursson - Copenhagen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to