create online files
<p>i want to make some .doc files with some entries in a database.
here is what i wrote:</p>

<pre><code>$name1=$user-&gt;username;
$name2=$nume;
$name3=$_POST['util'];
$cale="../doc/"; 
$file_name=$name1 . "_" .$name2."_".$name3;

$fp = fopen($cale, $file_name . ".doc", 'w+'); 

$message="Zhtml&gt;Zbody&gt; &lt;table width='100%' border='0'&gt;
&lt;tr&gt;
&lt;td align='center' width='15%'&gt;Data citire &lt;/td&gt;
&lt;td align='center' width='15%'&gt;Index &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td align='center' width='15%'&gt;CURRENT_DATE()&lt;/td&gt;
&lt;td align='center' width='15%'&gt;".$_POST['ind']."&lt;/td&gt;
&lt;/tr&gt;
&lt;/body&gt;
&lt;/html&gt;
";
fwrite($fp, $message);
fclose($fp);`
</code></pre>

<p>On localhost it works great, but when i upload it to a server it doesn't create the files..
I've set the permissions to 777 but still no luck.
also i've tried with other paths, even with no path. still nothing.
can someone help?</p>

<p>thank's
Sebastian</p>

<p>EDIT:
clearly the path is the problem, i made the whole site 777 and the file is created in the root folder.
i tried this:
<code>$cale=$_SERVER['DOCUMENT_ROOT'].'/components/com_calculator/doc/';</code> </p>

<p>but nothing. any ideas?</p>
