<?
session_start();
?>
<html>
<head>
<body>
<link rel="stylesheet" type="text/css" href="style.css">
<?
include('forb.php');
$q2 = mysql_query("select * from debat where id = '$_GET[id]'");
$se = mysql_fetch_array($q2);
$q1 = mysql_query("select * from brugere where brugernavn = '$_SESSION[Brugernavn]'");
$vis = mysql_fetch_array($q1);
if($se[locked] == '1'){
print "Debatten er lukket!";
}else{
$dato = date("d/m h:s:i");
if($se[locked] == '1' AND $vis[lock_debat] == '1'){
mysql_query("INSERT INTO debat_kommentar set kommentar = '$_POST[kommentar]', dato = '$dato', af = '$_SESSION[Brugernavn]', t_id = '$_GET[id]'");
print "<meta http-equiv='refresh' content='0; url=se_debat.php?id=$_GET[id]'>";
}else{
$dato = date("d/m h:s:i");
mysql_query("INSERT INTO debat_kommentar set kommentar = '$_POST[kommentar]', dato = '$dato', af = '$_SESSION[Brugernavn]', t_id = '$_GET[id]'");
print "<meta http-equiv='refresh' content='0; url=se_debat.php?id=$_GET[id]'>";
}
}
?>
</html>
</head>
</body>