you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see.
NOmagic_quotes_runtime Off
you actually managed to put the backslashes into your text file.
NO
.
.
.
.
,/()%...@!',''); //fix special chars in
name
$_POST[$fname.'_fname'] = strtr($_POST[$fname.'
PHP does *not* do the addslashes on $_POST when you cram something into it in
your PHP code.
It does it during the process of auto-filling up $_POST.
So either:
A) you have magic_quotes_runtime turned on LOCALLY. Use phpinfo() to see.
B) you actually managed to put the backslashes into yo
Hah! Forgot to add the link:
1. http://php.net/ini_set
How would you guys have ever figured out that was the page on PHP's
website you need to visit in order to view information about the
ini_set() function?!
;)
// Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
> -Original Message-
> From: MikeP [mailto:mpel...@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_
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
But this one is ON
magic_quotes_gpc
"Robert Cummings" wrote in message
news:1229567238.8302.35.ca...@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 wit
>From my phpinfo:
magic_quotes_runtime Off
"Robert Cummings" wrote in message
news:1229567238.8302.35.ca...@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 o
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 ge
Stut schreef:
> On 20 Nov 2008, at 01:29, Rene Fournier wrote:
>> I'm trying to understand something about fread(). I'm using fread() on
>> an incoming socket stream that will send, for example, 26630 characters:
>>
>> while ( ($buf=fread($read[$i], 8192)) != '' ) {
>> $sock_data .= $buf;
>>
On 20 Nov 2008, at 01:29, Rene Fournier wrote:
I'm trying to understand something about fread(). I'm using fread()
on an incoming socket stream that will send, for example, 26630
characters:
while ( ($buf=fread($read[$i], 8192)) != '' ) {
$sock_data .= $buf;
usleep(1000);
Rene Fournier wrote:
So my question is, why does fread wait if there is nothing more to
read? Shouldn't it return immediately? (That's what I want.) And as
for the delay, it's there so that if the incoming data is a little
slow, it has time to catch up with fread. Thanks.
...Rene
I do belie
On Mon, Jan 02, 2006 at 09:35:21PM +0100, Mario de Frutos Dieguez wrote:
> Hi!
>
> I have a problem using fread with a XML document. When i read some nodes
> with a great amount of text it cuts in the same place of the text. There
> are any limitation of text or something? I have in the php.ini th
Sorry for the bump, but please anyone? :P
Quoting The Gimper <[EMAIL PROTECTED]>:
> On the php.net you can read the following about fread:
>
> "fread() reads up to length bytes from the file pointer referenced by
> handle.
> Reading stops when length bytes have been read, EOF (end of file) is
>
Russell P Jones wrote:
> Is there any way to use fread() or a similar function to read a section of
> a document NOT starting at the beginning...
>
> for example, I can read the first 1000 bytes of a document with
>
> fread($doc, 1000);
>
> Is there any way to read the second 1000 bytes?
>
> perhap
I believe that fread uses the handle pointer from when it was opened
so...
None of the code is tested, I just typed it in.
class FileReader
{
//private
var $handle;
function FileReader($filePath)
{
$this->handle = fopen($filePath,'r');
}
On Thursday 06 March 2003 11:41, John Taylor-Johnston wrote:
> I need to upoload a local text file into memory using:
>
>
> The script below will only work if I am using my localhost.
>
> Any ideas?
What happens when you're NOT using localhost? And as this is an upload
problem, try searching the
At 05:46 03.03.2003, Paul Cohen said:
[snip]
>Here is the code in my file and was taken directly from the manual:
>
>$filename = "test.php";
>$handle = fopen ($filename, "r");
>$contents = fread ($handle, filesize ($filename));
>fclose ($handl
> I am trying to read a php file to a varible and then print that
variable.
> Unfortunately, my php file is not being parsed by the fread function
and I
> can't figure out why.
>
> Here is the code in my file and was taken directly from the manual:
>
> $filename = "test.php";
> $handle =
you'll have to exec() the code
$filename = "test.php";
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
exec($contents);
see if that works
Martin
> -Original Message-
> From: Paul Cohen [mailto:[EMAIL PROTECTE
Use readfile instead fread() if you've got some problem with, it looks
better!
Header("Content-Type: $type");
Header("Content-Disposition: attachment; filename=$downloadname");
header("Content-Length: $size");
header("Content-Transfer-Encoding: binary");
readfile($file);
- Original Message -
Would not be closing the conection in the perl script enough?
Martin Adler wrote:
Hi,
this php-script should read from a server (that i've written in perl) until
it receives the EOF signal.
My server sends the EOF-signal by
print $client "\n\004"; # \004 = EOF
to my script but fread would
res a session variable.
Zac
- Original Message -
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Zac Hillier'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 27, 2002 7:12 PM
Subject: RE: [PHP] fread and session vars
> Hi.
>
&g
Hi.
> Code:
>
> generate page script:
>
> $pge = create-page.php
> $pd = $HTTP_GET_VARS['pd'];
>
> # Set the files
> $crtPge = "/". $pge ."?pd=". $pd; # the url of the dynamic page to
write
> the
> output page
> $targetfilename = $SITE_ DOCUMENT_ROOT . $outPge; # the output page
>
> # delete
p.html') . " for writing.
Static page update aborted!");
exit();
}
#write to temp file
fwrite($tempfile, $htmldata);
# close the temp file
fclose($tempfile);
etc...
===
create-page.php:
To: "'Zac Hillier'&qu
Post some code. I don't understand completely what you're trying to do
or how you're trying to do it.
---John Holmes...
> -Original Message-
> From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 9:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] fread and session vars
> if( !($fd = @fopen($ftp_url, "r")) ){
> $error = true;
> $error_msg = "Unable to connect to server.";
> }
> else {
> $file_contents = fread($fd, 10);
> fclose($fd);
> }
>
> if( empty($file_contents) ){
> $error = true;
> $error_msg = "Did not read file.";
> }
>
>
> The problem is
David - very cool, thanks much for your help!
if any other newbies run into the same problem:
echo "stuff"; //prints "stuff"
echo $string; //prints contents of string, does NOT parse.
include(filename); //whenever encountered, prints contents of file
//parses only if PH
On Tue, 20 Feb 2001 11:37, Jaxon wrote:
> Same problem, found it's coming from somewhere else :(
> It looks as if fread or fopen is preventing PHP from from parsing ...
>
> index.php:
>
> $file="test.inc";
> $fd = fopen ($file, "r");
> $string = fread ($fd, filesize ($file));
> fclose ($fd);
> ec
On Fri, Feb 09, 2001 at 09:02:04AM -0600, Tyler Longren wrote:
> Could you perform fread() on a remote file?
Yes I could, and so can you, so why not try it?
An example:
$handle = fopen("http://www.php.net/manual/en/function.fread.php", "r");
while($line = fread($handle, 255)) {
echo "$line";
29 matches
Mail list logo