I finally finished my first own guestbook. I putted it up and everything worked fine but now it seems that if people use the 'enter' button al the text after this is not displayed. I know were the problem is: I write everithing seperated by |. for example:
johan|pazmany_johan@hotmail.com|www.odl.cruz.be|maar of er alles op komt is een ander vraag, ik heb precies veel meer getypt daarnet; dat de wedstrijd nog steeds van toepassing is op het nieuwe gastenboek hehe
johan|pazmany_johan@hotmail.com|www.odl.cruz.be|hierzie, voor mij macheert hem. en de wedstrijd loopt nog steeds hehe
Pé|peterhuygelen@hotmail.com|odl.cruz.be|wij willen smiley\'s!!
Every record is seperated because it begins on a new line; to read the information, I make an array of the file. And here's the problem; When te 'enter' button is used php looks at this as a new line in the array.
Does anyone know a cure for this guestbook-childdesease?
greetz,
<?
$array = file("gastenboek.txt");
foreach($array as $row) {
$line = explode("|", $row);
if (count($line) > 1) {
print "<table width=\"368\" border=\"1\" cellspacing=\"7\" bordercolor=\"#FFFFFF\" align=\"center\">
</tr>
<tr>
<td width=\"154\" bgcolor=\"#F4F4F4\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Naam
: </font></b></td>
<td width=\"205\" bgcolor=\"#FFCC00\" bordercolor=\"#000000\"><a href= mailto:$line[1]><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$line[0]</font></a></td>
</tr>
<tr>
<td width=\"154\" bgcolor=\"#F4F4F4\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Homepage
: </font></b></td>
<td width=\"205\" bgcolor=\"#FFCC00\" bordercolor=\"#000000\"><a href= [url]http://[/url]$line[2] target=\"_blank\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$line[2]</font></a></td>
</tr>
<tr>
<td width=\"154\" bgcolor=\"#F4F4F4\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">Comments
: </font></b></td>
<td rowspan=\"2\" bgcolor=\"#FFCC00\" bordercolor=\"#000000\" width=\"205\" valign=\"top\"><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">$line[3]</font></td>
</tr>
<tr>
<td width=\"154\" bgcolor=\"#FFFFFF\" height=\"80\"><b></b></td>
</tr>
<tr bordercolor=\"#FFFFFF\">
<td colspan=\"2\" height=\"8\">
<div align=\"center\">
<hr align=\"center\" noshade>
</div>
</td>
</table>
";
}
}
?>