<?php
if ($_POST ['submit']) {
$comment_title = $_POST['comment_title'];
$comment_datetime = $_POST['comment_datetime'];
$comment_main = $_POST['comment_main'];
$comment_author = $_POST['comment_author'];
$comment_main = nl2br($comment_main);
$comment_main = eregi_replace("\n", "", $comment_main);
$db = mysql_connect("localhost", "gregor", "Michelle") or
die ("Verbinding mislukt");
mysql_select_db("borner", $db);
$comment_SQL_insert = "INSERT INTO comment (comment_title, comment_datetime, comment_main, comment_author) VALUES ('$comment_title','$comment_datetime','$comment_main','$comment_author')";
mysql_query($comment_SQL_insert) or die (mysql_error());
mysql_close();
echo "Je bericht is opgenomen."
}
else { echo
?>
<form name="comment" action="insert.php" method="post">
<input type="text" name="comment_title">
<input type="text" name="comment_author">
<input type="hidden" name="comment_datetime" value="<?php echo date("Y-m-d H:i:s") ?>" size="19" maxlength="19">
<textarea name="comment_main">Plaats hier je reactie!</textarea>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
?>
heb alle forums bekeken! maar ik krijg iedere keer opnieuw het formulier te zien en niet het bericht dat het is toegeveoed aan de database!
HULP wordt zeer op prijs gesteld!
1.006 views