View previous topic :: View next topic |
Author |
Message |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Thu Dec 02, 2004 5:05 am Post subject: fwrite |
|
|
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 |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Dec 02, 2004 7:28 pm Post subject: |
|
|
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 |
|
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Fri Dec 03, 2004 2:32 am Post subject: |
|
|
It isn't a remote file. |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Dec 03, 2004 6:07 am Post subject: |
|
|
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 |
|
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Fri Dec 03, 2004 6:56 am Post subject: |
|
|
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 |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Fri Dec 03, 2004 4:34 pm Post subject: |
|
|
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 |
|
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Sat Dec 04, 2004 12:38 am Post subject: |
|
|
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 |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Sat Dec 04, 2004 3:54 am Post subject: |
|
|
No don't give up , make sure Register Globals is on , that could be the problem. |
|
Back to top |
|
 |
admin Site Admin
Joined: 03 Mar 2002 Posts: 1334
|
Posted: Sat Dec 04, 2004 2:01 pm Post subject: |
|
|
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 |
|
 |
|