Okay, I don't know what i'm doing wrong. I think this should work, but for some reason it doesn't. I have a form, and I want a HTML file to be written that includes the text that the user entered in the form. Am I using the right code? The textarea in my html form is called textoutput. and the form has it's info using post and action is createhtml.php which is the following file. what's wrong with my code?
WriteToFile ($textoutput)
{
$TheFile = "10dwf.html";
$Open = fopen ($TheFile, "w+");
if ($Open){
$teststring = "<head><title>Untitled Document</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head><body bgcolor=\"#FFFFFF\" text=\"#000000\"><div align=\"center\"><h1><b><font face=\"Arial, Helvetica, sans-serif\">Title Here</font></b></h1><hr><pre>$textoutput</pre></div></body>";
fwrite ($Open, $teststring);
fclose ($Open);
$Worked = True;
} else {
$Worked = False;
}
return $Worked;
}
?>