Nieuw lid |
|
Hey,
als ik op submit druk, dan doet hij niets. helemaal niets:p
dit is de code:
<?php
include("mysql.php");
?>
<?php
include("nieuws_sidebar.php");
?>
<?php
$id = $_GET['newsid'];
$sql = mysql_query("SELECT * FROM Nieuws WHERE ID = '".$_GET['newsid']."'")
or die (mysql_error());
?>
<table class="news" cellspacing="0" colspan="0">
<?php
while($row = mysql_fetch_assoc($sql)) {
echo "<tr><th>";
echo '<div align="center">';
echo '<a href=/?page=Nieuws&newsid='.$hoi['ID'].'> '.$row['Titel'].'';
echo "</div>";
echo "</th></tr>";
echo "<tr><td>";
echo $row['Bericht'];
echo "</td>";
echo '<tr><td align="right">';
echo 'Gepost op '.$row['Datum'].' door '.$row['Adder'].'';
echo "</td></tr>";
echo "</div>";
}
echo "</table>";
?>
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$datum = date("l, j F Y H:i");
$nid = $_GET['newsid'];
if (!empty($_POST['Comment'])) {
mysql_query("INSERT INTO `Comments` (`ID`, `nid`, `Naam`, `Comment`, `Datum`) VALUES ('','".$_GET['newsid']."', '".$_POST['Naam']."', '".$_POST['Comment']."', '".$datum."')") or die (mysql_error());
echo '<p>Comment geplaats.</p>';
}
else {
echo 'Niet alles is correct ingevuld.';
}
}
?>
<?php
$sql = mysql_query("SELECT * FROM Comments WHERE nid = '".$_GET['newsid']."'")
or die (mysql_error());
?>
<?php
while($row = mysql_fetch_assoc($sql)) {
echo '<br><table cellpadding=1 class=frame width=500>';
echo '<tr>';
echo '<td><b> '.$row['Naam'].' </b></td><td align=right> '.$row['Datum'].' </td>';
echo '</tr>';
echo '<tr>';
echo '<td height=1 bgcolor=white colspan=2></td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan=2> '.$row['Comment'].'</td>';
echo '</tr>';
echo '<tr>';
echo '<td height=1 bgcolor=white colspan=2></td>';
echo '</tr>';
}
echo '</table></table></br>';
?>
<table style="border: 1px solid white; padding: 4px; margin-left: 200px; background-color:#333; width:565px;>
<?php
echo '<form name="Addcomment" action="?page=Nieuws&newsid='.$_GET['newsid'].'" method="post" >';
?>
<tr><th style="border-bottom:1px solid white; padding-bottom:2px;">Voeg een reactie toe</th></tr>
<td>Naam:</td>
</tr>
<br>
<tr>
<td><input name="Naam" id="Naam" style="width: 100px; border: 1px solid black"></input><br><br>
</tr>
<tr>
<td>Reactie:</td>
</tr>
<tr>
<td><textarea name="comment-textarea" id="Comment" onfocus="this.value=''; setbg('#e5fff3');" onblur="setbg('white')">Reactie..</textarea></td>
</tr>
<tr>
<td><input type="submit" name="box" value="POST" id="box" style="width: 50px; border: 1px solid #82D547; "></td>
</tr>
</form>
</table>
</center>
<div class="meer_nieuws"><a href="?page=allnews" title="Keer terug naar nieuws" class="meernieuws">« Terug naar nieuws</a></div>
<?php include("mysql.php"); ?> <?php include("nieuws_sidebar.php"); ?> <?php $id = $_GET['newsid']; $sql = mysql_query("SELECT * FROM Nieuws WHERE ID = '".$_GET['newsid']."'") ?> <table class="news" cellspacing="0" colspan="0"> <?php echo '<div align="center">'; echo '<a href=/?page=Nieuws&newsid='.$hoi['ID'].'> '.$row['Titel'].''; echo '<tr><td align="right">'; echo 'Gepost op '.$row['Datum'].' door '.$row['Adder'].''; } ?> <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $datum = date("l, j F Y H:i"); $nid = $_GET['newsid']; if (!empty($_POST['Comment'])) { mysql_query("INSERT INTO `Comments` (`ID`, `nid`, `Naam`, `Comment`, `Datum`) VALUES ('','".$_GET['newsid']."', '".$_POST['Naam']."', '".$_POST['Comment']."', '".$datum."')") or die (mysql_error()); echo '<p>Comment geplaats.</p>'; } else { echo 'Niet alles is correct ingevuld.'; } } ?> <?php $sql = mysql_query("SELECT * FROM Comments WHERE nid = '".$_GET['newsid']."'") ?> <?php echo '<br><table cellpadding=1 class=frame width=500>'; echo '<td><b> '.$row['Naam'].' </b></td><td align=right> '.$row['Datum'].' </td>'; echo '<td height=1 bgcolor=white colspan=2></td>'; echo '<td colspan=2> '.$row['Comment'].'</td>'; echo '<td height=1 bgcolor=white colspan=2></td>'; } echo '</table></table></br>'; ?> <table style="border: 1px solid white; padding: 4px; margin-left: 200px; background-color:#333; width:565px;> <?php echo '<form name="Addcomment" action="?page=Nieuws&newsid='.$_GET['newsid'].'" method="post" >'; ?> <tr><th style="border-bottom:1px solid white; padding-bottom:2px;">Voeg een reactie toe</th></tr> <td>Naam:</td> </tr> <br> <tr> <td><input name="Naam" id="Naam" style="width: 100px; border: 1px solid black"></input><br><br> </tr> <tr> <td>Reactie:</td> </tr> <tr> <td><textarea name="comment-textarea" id="Comment" onfocus="this.value=''; setbg('#e5fff3');" onblur="setbg('white')">Reactie..</textarea></td> </tr> <tr> <td><input type="submit" name="box" value="POST" id="box" style="width: 50px; border: 1px solid #82D547; "></td> </tr> </form> </table> </center> <div class="meer_nieuws"><a href="?page=allnews" title="Keer terug naar nieuws" class="meernieuws">« Terug naar nieuws</a></div>
regel 89 dacht ik xD
iemand enig idee?
gr pakito
|