chmod 777 and fwrite
Posted: Sun Dec 04, 2005 3:07 pm
This has probably been asked before but here goes. I have chmod'd a file to 0777 on one site. I'm trying to write to that file from another site using an "http" address for the file location. What would prevent me from writing to the file? I did a is_writable() test on the file and didn't succeed. Any comment on today's experiment would be appreciated... Thanks.
Yes that's the address. There must be something I'm not understanding. Feel free to tell me I'm cracked and it won't work.
Code: Select all
<?php
$file = "http://www.ritterfamily.org/rf/this.html";
if ($fh = @fopen($file, 'w')) {
while(!feof($fh)){
echo fgets($fh);
}
if(fwrite($fh, "You've been pwnd")== 0){
fclose($fh);
} else {
echo "no write";
}
} else {
echo "not open";
}
?>