fwrite

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Thu Dec 02, 2004 5:05 am    Post subject: fwrite Reply with quote

My fwrite command in php is working, except the http wrapper doesn't support writeable connections. I was wondering if there was a way to fix this?
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Dec 02, 2004 7:28 pm    Post subject: Reply with quote

You cannot write to a remote file , it has to be local or their would be many
reports of people hacking their text files using PHP lol. Have A Nice Day...

Note: You can only read a remote file with PHP. LateR!
Back to top View user's profile Send private message Visit poster's website
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Fri Dec 03, 2004 2:32 am    Post subject: Reply with quote

It isn't a remote file.
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Dec 03, 2004 6:07 am    Post subject: Reply with quote

My point is that you cannot write to a file using http://

Note: You can read from a http:// location and then write that information
to another file on your local Server but thats about all you can do. LateR!

Can you post your PHP script and explain what your trying to do ?
Back to top View user's profile Send private message Visit poster's website
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Fri Dec 03, 2004 6:56 am    Post subject: Reply with quote

I know what you mean, Im not new to the php enviorment. Im plainly trying to write a file with fwrite in htdocs using:
Code:

<?php
$fp = fopen("inc_code_list.php","a");
if(!$fp) {
   print "PHP error opening file.";
   exit;
}
$allstrings=$listhead.$code.$listmiddle.$due.$endlist;
$list=$allstrings;
fwrite($fp, $list);
fclose($fp);
?>
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Dec 03, 2004 4:34 pm    Post subject: Reply with quote

Your code looks fine , its just what you said that had me confused since the
fwrite function can only work on local files while you where saying http:// and
that had me a little confused , is everything working correctly now ?
Back to top View user's profile Send private message Visit poster's website
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Sat Dec 04, 2004 12:38 am    Post subject: Reply with quote

Thats what questions me. I tested the code on a hosted site and it worked fine, but it wont work on my webserver. I think Ill just scratch it and find a good host. Thanks anyways.
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Sat Dec 04, 2004 3:54 am    Post subject: Reply with quote

No don't give up , make sure Register Globals is on , that could be the problem.
Back to top View user's profile Send private message Visit poster's website
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1334

PostPosted: Sat Dec 04, 2004 2:01 pm    Post subject: Reply with quote

Glitch2082,

Your code is fine. But to know why it doesn't work for you, change it so it can display human readable error messages when fopen or fwrite fails. That's always better for debugging than guessing.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group