Re: stripslashes()

From: Date: Sun, 02 Mar 2003 02:56:20 +0000
Subject: Re: stripslashes()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137745@lists.php.net to get a copy of this message
At 03:37 02.03.2003, Dade Register said: --------------------[snip]-------------------- >I know I am doing the exact thing you are.... If you >or someone else doesn't mind, could you look @ >http://dragonz-cavern.mine.nu/poems.phps and see what >I'm doing wrong? I am trying to parse it before it >gets stored in my txt file. plz help. I'd really >appreciate it. --------------------[snip]-------------------- You're doing everything right. If you have a look at the datfile you'll notice there are NO backslashes. Right? Ok, so the culprit must be fgets() - and indeed this can be found in the online manual (http://www.php.net/manual/en/function.fgets.php), in the user comments: php at silisoftware dot com 13-Jun-2002 06:44 Beware of magic_quotes_runtime ! php.ini-recommended for PHP v4.2.1 (Windows) had magic_quotes_runtime set ON, and that addslash'd all input read via fgets() So the solution here is to either add stripslashes() after your datfile read, or to use set_magic_quotes_runtime(0) (see http://www.php.net/manual/en/function.set-magic-quotes-runtime.php). -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#137745) next »