I have a html form that submits results to a text file. This is then opened and read into a table producing a new line for each post in an new page. My problem is when a user hits enter in the textarea (Details) on the initial form, this seriously throws out my table when reading the results from the text file, spreading the lines from the 'details' textarea in diff cells of the table.
If the user doesnt hit enter in the initial textarea there is no problem on the initial textarea. CAN ANYBODY HELP ME!?!?
$myFile = "details.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = $fname. "\t".$lname. "\t".$phone. "\t".$positiontype. "\t".$details. "\t".$education. "\t".$TofD."\n";
fwrite($fh, $stringData);
fclose($fh);
and then it is placed in table line by line:
echo "<table border=1 bgcolor = \"#000000\" bordercolor = \"#333333\"> \n";
echo "<tr><th>First Name</td>
<th>Surname</td>
<th>Phone No</td>
<th>Position Type</td>
<th>Details</td>
<th>Education</td>
<th>Time of Day to Contact</td>
</tr>";
for ($i=0; $i<$number_posts; $i++)
{
//split the lines
$line = explode ( "\t", $test[$i] );
echo "<tr><td>$line[0]</td>
<td>$line[1]</td>
<td>$line[2]</td>
<td>$line[3]</td>
<td>$line[4]</td>
<td>$line[5]</td>
<td>$line[6]</td>
</tr>";
}
echo "</table>";
?>