OK i figured it out, I was missing an include statement
now i have this
<?
include("conf.php");
$textarea[1] = "$sent1";
$textarea[2] = "$sent2";
$textarea[3] = "$sent3";
$textarea[4] = "$sent4";
$textarea[5] = "$sent5";
$textarea[6] = "$sent6";
$textarea[7] = "$sent7";
$counttextareas = count($textarea);
$array = array();
FOR($i = 1; $i <= $counttextareas; $i++) {
array_push($array, $textarea[$i]);
$filename = 'test1.html';
$somecontent = $textarea[$i];
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)<br><br>";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
}
?>
I need to figure out how to write the contents in that test1.html file to have carriage retuns. Right now when u open test1.html, all the values are on one line.
I also still need to know how to write the file to todays date
Thankyou 😃