RE: [PHP] fread question
| From: | Boyd, Todd M. | Date: | Thu, 18 Dec 2008 15:27:12 +0000 |
| Subject: | RE: [PHP] fread question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284786@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: MikeP [mailto:mpeloso@princeton.edu]
> Sent: Thursday, December 18, 2008 7:33 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] fread question
>
> Still having problems:
> magic_quotes_runtime is off
> BUT
> magic_quotes_gpc is on
> I cant change them myself so I tried
> stripslashes
> That doesnt work though:
>
> $_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']);
> $test=$_POST[$fname];
> $test3=stripslashes($test);
>
> $test3 and $test are the same.
>
> Any other Ideas?
>
> "Robert Cummings" <robert@interjinn.com> wrote in message
> news:1229567238.8302.35.camel@localhost...
> > On Wed, 2008-12-17 at 19:54 -0500, MikeP wrote:
> >> Hello,
> >> I have been trying to use fread to open a file, but it always
> escapes
> >> special characters.
> >> How do I open afile without it modifying my original file:
> >>
> >> $_POST[$fname] = fread($fileHandle, $_POST[$fname.'_size']);
> >> I use this and get slashes everywhere.This kills my REGex that gets
> coded
> >> next.
> >
> > Check this magically shitty setting in your php.ini:
> >
> > magic_quotes_runtime
> >
> > It should be off unless someone with less brains than a turd got a
> hold
> > of your ini file.
The PHP site's page on ini_set() [1] talks a bit about how to set that
particular option in an .htaccess file:
set PHP_INI_PERDIR settings in a .htaccess file with 'php_flag'
like this:
php_flag register_globals off
php_flag magic_quotes_gpc on
If you can get at your .htaccess, maybe you could do it that way (since
I don't believe you can change magic_quotes_gpc using ini_set() or
similar methods).
HTH,
// Todd