soma56 Posted July 15, 2010 Share Posted July 15, 2010 I'm researching fopen and found this example which works fine: <?php $filename = 'test.txt'; $somecontent = "Add more to the file\n"; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> However, when I attempt to write to a specific domain path it doesn't work: $filename = 'http://www.myodmain.com/php/test.txt'; I've chmod the file to make it writable - just curious as to what the cause could be. Link to comment https://forums.phpfreaks.com/topic/207844-fopen-to-specific-url-path/ Share on other sites More sharing options...
salathe Posted July 15, 2010 Share Posted July 15, 2010 You can't write to the interwebs. Link to comment https://forums.phpfreaks.com/topic/207844-fopen-to-specific-url-path/#findComment-1086533 Share on other sites More sharing options...
soma56 Posted July 15, 2010 Author Share Posted July 15, 2010 Thank you - just needed to hear it to make sure. Link to comment https://forums.phpfreaks.com/topic/207844-fopen-to-specific-url-path/#findComment-1086749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.