Page 1 of 1

fopen not working on remote files

Posted: Wed Jul 22, 2009 3:16 am
by jorj
please help


i am using this code

Code: Select all

fopen("http://localhost/file.php", "w+")
but the output is always

Warning: fopen(http://localhost/file.php) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in X:\xampp\htdocs\editor.php on line 27

how should i access a remote file???

Re: fopen not working on remote files

Posted: Wed Jul 22, 2009 3:37 am
by Darhazer
You cannot access remote file for writing (unless the remote file is not mounted by the operating system). You have to access a PHP script on the remote server, that works with the file...

Re: fopen not working on remote files

Posted: Wed Jul 22, 2009 3:42 am
by jorj
i'm sorry for that what i mean is that i can't access files using http

is there a problem with localhost

how should i do that?

please help...


just a beginner... first month

Re: fopen not working on remote files

Posted: Wed Jul 22, 2009 4:47 am
by Darhazer
If you want to read file, use:
fopen("http://localhost/file.php", "r")
If you want to write to the file... you can't
What will happen if everyone could write to every site he wants?