I am learning php trying to use a function fopen(). The php file that I am encoding is in this directory. /domains/xxxxx.com.au/public_html/phpfile.php
What path should I specify for an open file, the example I'm looking for is based on a server on a computer, where is the path to the file $filename = "c:/newfile.txt";, not the Internet server.
UPDATE!
This is the whole script, I have the correct file location, now <4> w371> "can not create the file" is returned. Does this have anything to do with the permission of the folder in the file folder?
<?php
$filename = "/domains/xxxxxxxx.com.au/public_html/newfile.txt";
$newfile = @fopen($filename, "w+") or die ("couldnt create the file");
fclose($newfile);
$msg = "<p>File Created</p>";
?>
<HTML>
<HEAD>
</HEAD>
<BODY>
<? echo "$msg" ?>
</BODY>
</HTML>
source
share