this is the error message when I load the readdata.php
Warning: REG_EMPTY: in F:\http\php\poort\readdata.php on line 10
naam: e-mail: bericht:
here is the code
form.html
<html>
<form method="post" enctype="multipart/form-data" action="write.php">
naam<input type=text maxlength="255" size="30" name="naam">
e-mail<input type=text maxlength="255" size="30" name="email">
bericht<textarea name="bericht" cols="25" rows=5></textarea>
<input type="submit" value=Submit>
</form>
</html>
write.php
<a href="readdata.php">uitlezen</a><br>
<br>
<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
$bestand = "gastenboek.dat";
$bestand_file = file($bestand);
$file_open = fopen($bestand, "a");
$bericht = nl2br($bericht);
fwrite($file_open, "$naam|$email|$bericht\n");
fclose($file_open);
echo("Data toegevoegd!");
?>
readdata.php
<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
$bestand = "gastenboek.dat";
if(!file_exists($bestand)){
die("Error: file not available");
}
$bestand_file = file($bestand);
foreach($bestand_file as $regel){
list($naam, $email, $bericht)= split ("|", $regel);
$bericht = ereg_replace("\n", "", $bericht);
echo "<table border=1>\n\t<tr>\n\t\t";
echo "<td>\n\t\tnaam: ".$naam."\n\t\t</td>\n\t\t";
echo "<td>\n\t\te-mail: ".$email."\n\t\t</td>\n\t\t";
echo "<td>\n\t\tbericht: ".$bericht."\n\t\t</td>\n\t";
echo "</tr>\n</table>";
}
?>