Re: [PHP] fread question

2008-12-18 Thread MikeP
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.'

Re: [PHP] fread question

2008-12-18 Thread ceo
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

RE: [PHP] fread question

2008-12-18 Thread Boyd, Todd M.
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,

RE: [PHP] fread question

2008-12-18 Thread Boyd, Todd M.
> -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_

Re: [PHP] fread question

2008-12-18 Thread MikeP
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

Re: [PHP] fread question

2008-12-18 Thread MikeP
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

Re: [PHP] fread question

2008-12-18 Thread MikeP
>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

Re: [PHP] fread question

2008-12-17 Thread Robert Cummings
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

Re: [PHP] fread() behaviour

2008-11-20 Thread Jochem Maas
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; >>

Re: [PHP] fread() behaviour

2008-11-20 Thread Stut
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);

Re: [PHP] fread() behaviour

2008-11-19 Thread Craige Leeder
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

Re: [PHP] fread problem

2006-01-04 Thread Curt Zirzow
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

Re: [PHP] fread and fgets (network streams)

2005-09-04 Thread The Gimper
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 >

Re: [PHP] fread()

2004-12-09 Thread Richard Lynch
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

RE: [PHP] fread()

2004-12-08 Thread Justin Palmer
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'); }

Re: [PHP] fread or not?

2003-03-05 Thread Jason Wong
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

Re: [PHP] fread problem

2003-03-03 Thread Ernest E Vogelsinger
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

RE: [PHP] fread problem

2003-03-02 Thread John W. Holmes
> 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 =

RE: [PHP] fread problem

2003-03-02 Thread Martin Towell
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

Re: [PHP] fread() fails with large files

2002-11-03 Thread rija
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 -

Re: [PHP] fread & EOF

2002-10-29 Thread Marek Kilimajer
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

Re: [PHP] fread and session vars

2002-05-27 Thread Zac Hillier
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

RE: [PHP] fread and session vars

2002-05-27 Thread John Holmes
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

Re: [PHP] fread and session vars

2002-05-27 Thread Zac Hillier
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

RE: [PHP] fread and session vars

2002-05-27 Thread John Holmes
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

Re: [PHP] fread over ftp

2001-02-23 Thread Richard Lynch
> 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

Re: [PHP] fread strangeness (was: nested echo and includes, mixedhtml / PHP)

2001-02-19 Thread Jaxon
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

Re: [PHP] fread strangeness (was: nested echo and includes, mixed html / PHP)

2001-02-19 Thread David Robley
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

Re: [PHP] fread() a remote file

2001-02-09 Thread Jason Stechschulte
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";