How to use the php fopen() correctly
<p>I am learning php, trying to use the <code>fopen()</code> function.
The php file I am coding is in this directory <code>/domains/xxxxx.com.au/public_html/phpfile.php</code>
What path do I specify for the file to be opened, the example I am looking at is based on a server on a pc where this is the file path <code>$filename = "c:/newfile.txt";</code> not an online server. </p>

<p>UPDATE!</p>

<p>This is the whole script, I have the file location correct, now the4 script is returning "couldnt create the file" does this have something to do with ther permission of the folder location of the file?</p>

<pre><code>   &lt;?php
$filename = "/domains/xxxxxxxx.com.au/public_html/newfile.txt";
$newfile = @fopen($filename, "w+") or die ("couldnt create the file");
fclose($newfile);
$msg = "&lt;p&gt;File Created&lt;/p&gt;";
?&gt;

&lt;HTML&gt;
&lt;HEAD&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;

&lt;? echo "$msg" ?&gt;

&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>
