Re: FW: [SPAM] RE: [PHP] fwrite() Append Files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Boyd, Todd M. wrote:
-----Original Message-----
From: Chris Scott [mailto:Chris.Scott@xxxxxxxxxx]
Sent: Friday, June 27, 2008 8:48 AM
To: php-general@xxxxxxxxxxxxx
Subject:  FW: [SPAM] RE: [PHP] fwrite() Append Files
Importance: Low

I don't think you can open files for writing over http, you get an
error:

failed to open stream: HTTP wrapper does not support writeable
connections.

-----Original Message-----
From: Per Jessen [mailto:per@xxxxxxxxxxxx]
Sent: Friday, June 27, 2008 2:39 PM
To: php-general@xxxxxxxxxxxxx
Subject: [SPAM] RE:  fwrite() Append Files
Importance: Low

Wei, Alice J. wrote:

Do you mean to edit $ourFileHandle to fopen($ourFileName, 'wba')?

I think fopen($ourFileName, 'a') will do what you want.

From Alice's code:

   $ourFileName = "hello.txt";

   $ourFileHandle = fopen($ourFileName, 'wb') or die("can't open file");

So... she is not, in fact, trying to write a file over HTTP. She is reading a file via HTTP and writing something pertaining to it on the local file system.

Also, please refrain from top-posting. It makes the posts get very confusing. :(


Todd Boyd
Web Programmer




Todd, if you look at her initial code posted in the other thread, you will see that she WAS infact trying to write the file to a remote server.

The two URLs were www.mysite.com/hello.txt and www.yoursite.com/hello.txt

That would have been trying to write the new file of http. so he was right in saying what he said. Not sure where you got the above code snippet, but it is not from what she originally posted to the list.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux