Image

Imagebad_lcuk wrote in Imagephp

Hi!
I wasnt too sure where to go! I am a bit stuck. I am trying to write a little
I am just trying to use a php script to save information from an html form to a text file. I am using my universities provided server for my three little files. My form html page, the writetofile.php it calls, and the data.txt file where id want my data to be saved. It seems no matter what i do, no matter how many examples i look at, i cant seem to get it to write to my txt file.



My html page form calls: <form name="form" action="writetofile.php" method="post" enctype="multipart/form-data"> .... </form>
and i have also included <? php include "writetofile.php" ?> in the body as well.

my writetofile.php is set up like an html page with <html><head></head><body> and within the body my php code sits:
<? $text = $_REQUEST('info');
$myFile = "data.txt"
$fileOpen = fopen($myFile, "a"); (I do want to append the data)
$stringData = "test information\n";
fwrite($fileOpen, $stringData);
fclose($fileOpen);
?>

Sorry if its a bit long. Any ideas where im going wrong? I feel like its a very small syntax error that im just glazing over.