rendered paste body<?php
$con = mysql_connect("localhost", "root", "root") or die(mysql_error());
$db = mysql_select_db("except") or die(mysql_error());
if ( !empty($_POST['comnick']) && !empty($_POST['comment']) )
{
$comment = trim($_POST['comment']);
$comnick = trim($_POST['comnick']);
$laggTill = "INSERT INTO commentsys
(comment, comnick) VALUES ('$comment', '$comnick')";
mysql_query($laggTill) or
die("Det gick inte att lägga till informationen!");
}
else
{
// Skriv ut hela html-formen här,
}
mysql_close($con);
?>