View Single Post

  #1 (permalink)  
Old 05-10-2008
kronecker@yahoo.co.uk
 
Posts: n/a
Default Writing to a server text file

I have this

<html>

<head>
<title>My Program</title>
</head>


<body>
<div>
<?

$file = ("remote.txt"); //file where data is stored
Print "Writing to $file "
$fp = fopen($file , "w"); //open the file for write
fputs($fp , "my text here"); //write the new value to the
file

fclose($fp); //close the file


?>
</div>
</body>


</html>

which runs nothing happens to the text file remote.txt - it remains
empty.
I suppose it could be its permissions - how to change these - this is
not a Unix system or at least I don't have access to the chmod
command. Or could there be something else wrong with my script? Should
the text file appear in the same directory? I created it myself and it
stays empy. Is this all I need for PHP or must I put it in a special
directory. This is an index.html file.

Thanks

K.
Reply With Quote