Nieuwssysteem 2.1.3 [Reacties en Admin]
Auteur: Joel - 19 augustus 2004 - 00:15 - Gekeurd door: Dennisvb - Hits: 16586 - Aantal punten: 3.83 (12 stemmen)
Dit is een nieuwssysteem met volgende onderwerpen:
-pagina met instellingen (config.php)
-pagina met al het nieuws (nieuws.php)
-pagina met reacties + reactie toevoegen (nieuwscomments.php)
-nieuwstoevoegen (nieuwstoevoegen.php)
-pagina met admin (admin.php)
-nieuwsverwijderen (verwijdernieuws.php)
-nieuwsveranderen (verandernieuws.php)
Je moet ook nog 2 tabellen maken in je database:
#
# Table structure for table 'nieuwscomments'
#
CREATE TABLE `nieuwscomments` (
`id` int(10) NOT NULL auto_increment,
`nieuwsid` int(10) NOT NULL default '0',
`naam` varchar(20) NOT NULL default '',
`emailadres` varchar(50) NOT NULL default '',
`bericht` text NOT NULL,
`tijd` varchar(10) NOT NULL default '',
`datum` varchar(10) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
#
# Table structure for table 'nieuws'
#
CREATE TABLE `nieuws` (
`id` mediumint(10) NOT NULL auto_increment,
`onderwerp` varchar(100) NOT NULL default '',
`naam` varchar(20) NOT NULL default '',
`emailadres` varchar(80) NOT NULL default '',
`bericht` text NOT NULL,
`datum` varchar(30) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
# # Table structure for table 'nieuwscomments' # CREATE TABLE `nieuwscomments` ( `id` int(10) NOT NULL auto_increment, `nieuwsid` int(10) NOT NULL default '0', `naam` varchar(20) NOT NULL default '', `emailadres` varchar(50) NOT NULL default '', `bericht` text NOT NULL, `tijd` varchar(10) NOT NULL default '', `datum` varchar(10) NOT NULL default '', ) TYPE=MyISAM; # # Table structure for table 'nieuws' # CREATE TABLE `nieuws` ( `id` mediumint(10) NOT NULL auto_increment, `onderwerp` varchar(100) NOT NULL default '', `naam` varchar(20) NOT NULL default '', `emailadres` varchar(80) NOT NULL default '', `bericht` text NOT NULL, `datum` varchar(30) NOT NULL default '', ) TYPE=MyISAM;
Veel succes met dit nieuwsscript.
|
Code: |
##########
Config.php
##########
<?php
/* mysql */
mysql_connect ("localhost","jegebruikersnaam","jepassword");
mysql_select_db("databasenaam");
/* algemeen */
$max = 10; //hoeveel berichten er op 1 pagina mag komen
?>
<style>
a:link { text-decoration: none; }
a:active { text-decoration: none; }
a:visited { text-decoration: none; }
a:hover { text-decoration: none; }
</style>
<body bgcolor="#e2e2e2">
<?php /* mysql */ /* algemeen */ $max = 10; //hoeveel berichten er op 1 pagina mag komen ?> <style> a:link { text-decoration: none; } a:active { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } </style> <body bgcolor="#e2e2e2">
##########
Nieuws.php
##########
<?php
include ('config.php');
$sql = "SELECT * FROM nieuws ORDER BY ID DESC";
$query = mysql_query($sql) or die(mysql_error());
$rtel = mysql_num_rows($query);
if ($rtel < 1) {
echo "<div align=center><font face=verdana size=-1>Er zijn nog geen nieuwsberichten</font></div>";
} else {
$rtel/=$max;
if (empty($pagina)) $pagina=1;
$van=($pagina-1)*$max;
if ($pagina > ceil($rtel)) $pagina=1;
for ($i = 1; $i <= ceil($rtel); $i++) {
if ($pagina == $i)
$paginas[$i] = "<b>".$i."</b>";
else
$paginas[$i] = "<a href=\"".$_SERVER['REQUEST_URI']."?pagina=".$i."\">".$i."</a>";
}
$paginas= implode(" | ", $paginas);
$vorige = ($pagina-1) ? "<a href=\"".$_SERVER['REQUEST_URI']."?pagina=" . ($pagina - 1)
. "\">< Vorige</a>" : "";
$volgende = ($pagina-ceil($rtel)) ? "<a href=\"$php_self?pagina=" .
($pagina + 1) . "\">Volgende ></a>" : "";
if ($vorige && $volgende) {
$navigatie = ("<font face=\"verdana\" size=\"-1\" color=\"#000000\">
".$vorige." <font color=\"#000000\">|</font> ".$paginas."
<font face=\"verdana\" size=\"-1\" color=\"#000000\"> |</font> ".$volgende."</font>");
} else {
$navigatie = ("<font face=\"verdana\" size=\"-1\" color=\"#000000\">
".$vorige." <font color=\"#000000\">|</font> ".$paginas." <font face=\"verdana\"
size=\"-1\" color=\"#000000\">|</font> ".$volgende."</font>");
}
$query = mysql_query("SELECT * FROM nieuws ORDER BY id DESC LIMIT ".$van.", ".$max);
while ($obj = mysql_fetch_object($query)) {
$bericht = htmlspecialchars($obj->bericht);
$bericht = nl2br($bericht);
$bericht = wordwrap($bericht, 60, "\n", 1);
$nieuwsid = $obj->id;
$rij = mysql_query("SELECT * FROM nieuwscomments WHERE nieuwsid=".$nieuwsid." ORDER BY id DESC");
$comments = mysql_num_rows($rij);
if ($comments == "1")
$commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">".$comments." reactie</font></a>";
else
$commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">".$comments." reacties</font></a>";
if ($comments == "0")
$commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">Post een reactie</font></a>";
?>
<div align="center">
<table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000">
<tr bgcolor="#999999">
<td width="35%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Onderwerp:</b>
<?php echo $obj->onderwerp; ?></font></td>
<td width="29%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
door:</b> <?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\">".$obj->naam."</font></a>"; ?></font></td>
<td width="36%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
op:</b> <?= $obj->datum; ?></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="3">
<font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><?= $bericht; ?>
</font></td>
</tr>
<tr bgcolor="#999999">
<td colspan="3">
<div align="right">
<font face="Verdana, Arial, Helvetica, sans-serif" size="-1">
[ <?= $commentsnaam; ?> ]
</font>
</div>
</td>
</tr>
</table>
</div>
<br>
<?php } ?>
<div align="center">
<table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#000000" bgcolor="#666666">
<tr>
<td bgcolor="#999999">
<div align="center"><font size="-1"><?= $navigatie; ?></font></div>
</td>
</tr>
</table>
</div>
<?php } ?>
<?php include ('config.php'); $sql = "SELECT * FROM nieuws ORDER BY ID DESC"; if ($rtel < 1) { echo "<div align=center><font face=verdana size=-1>Er zijn nog geen nieuwsberichten</font></div>"; } else { $rtel/=$max; if (empty($pagina)) $pagina=1; $van=($pagina-1)*$max; if ($pagina > ceil($rtel)) $pagina=1; for ($i = 1; $i <= ceil($rtel); $i++) { if ($pagina == $i) $paginas[$i] = "<b>".$i."</b>"; else $paginas[$i] = "<a href=\"".$_SERVER['REQUEST_URI']."?pagina=".$i."\">".$i."</a>"; } $paginas= implode(" | ", $paginas); $vorige = ($pagina-1) ? "<a href=\"".$_SERVER['REQUEST_URI']."?pagina=" . ($pagina - 1) . "\">< Vorige</a>" : ""; $volgende = ($pagina-ceil($rtel)) ? "<a href=\"$php_self?pagina=" . ($pagina + 1) . "\">Volgende ></a>" : ""; if ($vorige && $volgende) { $navigatie = ("<font face=\"verdana\" size=\"-1\" color=\"#000000\"> ".$vorige." <font color=\"#000000\">|</font> ".$paginas." <font face=\"verdana\" size=\"-1\" color=\"#000000\"> |</font> ".$volgende."</font>"); } else { $navigatie = ("<font face=\"verdana\" size=\"-1\" color=\"#000000\"> ".$vorige." <font color=\"#000000\">|</font> ".$paginas." <font face=\"verdana\" size=\"-1\" color=\"#000000\">|</font> ".$volgende."</font>"); } $query = mysql_query("SELECT * FROM nieuws ORDER BY id DESC LIMIT ".$van.", ".$max); $bericht = nl2br($bericht); $bericht = wordwrap($bericht, 60, "\n", 1); $nieuwsid = $obj->id; $rij = mysql_query("SELECT * FROM nieuwscomments WHERE nieuwsid=".$nieuwsid." ORDER BY id DESC"); if ($comments == "1") $commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">".$comments." reactie</font></a>"; else $commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">".$comments." reacties</font></a>"; if ($comments == "0") $commentsnaam ="<a href=\"nieuwscomments.php?nieuwsid=".$nieuwsid."\"><font color=\"#000080\">Post een reactie</font></a>"; ?> <div align="center"> <table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000"> <tr bgcolor="#999999"> <td width="35%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Onderwerp:</b> <?php echo $obj->onderwerp; ?></font></td> <td width="29%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost door:</b> <?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\">".$obj->naam."</font></a>"; ?></font></td> <td width="36%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost op:</b> <?= $obj->datum; ?></font></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="3"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><?= $bericht; ?> </font></td> </tr> <tr bgcolor="#999999"> <td colspan="3"> <div align="right"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1"> [ <?= $commentsnaam; ?> ] </font> </div> </td> </tr> </table> </div> <br> <?php } ?> <div align="center"> <table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#000000" bgcolor="#666666"> <tr> <td bgcolor="#999999"> <div align="center"><font size="-1"><?= $navigatie; ?></font></div> </td> </tr> </table> </div> <?php } ?>
##################
Nieuwscomments.php
##################
<?php
ob_start();
include ('config.php');
$nieuwsid=$_GET['nieuwsid'];
$query=mysql_query("SELECT * FROM nieuws where id=".$nieuwsid) or die(mysql_error());
$obj=mysql_fetch_object($query);
$bericht = htmlspecialchars($obj->bericht);
$bericht = nl2br($bericht);
$bericht = wordwrap($bericht, 60, "\n", 1 );
?>
<div align="center">
<table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000">
<tr bgcolor="#999999">
<td width="35%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Onderwerp:</b>
<?= $obj->onderwerp; ?></font></td>
<td width="29%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
door:</b> <?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\">
".$obj->naam."</font></a>"; ?></font></td>
<td width="36%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
op:</b> <?= $obj->datum; ?></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="3">
<font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><?= $bericht; ?>
</font></td>
</tr>
</table>
</div>
<br>
<hr width="89%" color="black">
<br>
<?php
$query=mysql_query("SELECT * FROM nieuwscomments WHERE nieuwsid=".$nieuwsid) or die(mysql_error());
while($obj= mysql_fetch_object($query)) {
$bericht = htmlspecialchars($obj->bericht);
$bericht = nl2br($bericht);
$bericht = wordwrap($bericht, 60, "\n", 1 );
$aantal=mysql_num_rows($query);
if ($aantal > 0) {
?>
<div align="center">
<table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000">
<tr bgcolor="#999999">
<td width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
door:</b>
<?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\">
".$obj->naam."</font></a>"; ?>
</font></td>
<td width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost
op:</b>
<?php echo $obj->datum." - ".$obj->tijd; ?>
</font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1">
<?= $bericht; ?>
</font></td>
</tr>
</table>
</div>
<br>
<?php
}
}
?>
<?php
$datum = date("d/m/Y");
$tijd = date("H:i");
if (isset($_POST['Submit'])) {
if (!isset($_POST['berichtreactie']))
$error = "Je moet een bericht invullen";
if (!isset($_POST['emailadres']))
$error = "Je moet je e-mailadres invullen";
if (!isset($_POST['naam']))
$error = "Je moet je naam invullen";
if (!$error) {
$query ="INSERT INTO nieuwscomments (naam, tijd, datum, bericht,
nieuwsid, emailadres) VALUES ('".$_POST['naam']."', '".$_POST['tijd']."', '".$_POST['datum']."',
'".$_POST['berichtreactie']."', '".$_POST['nieuwsid']."', '".$_POST['emailadres']."')";
mysql_query($query) or die (mysql_error());
header("location:".$_SERVER['REQUEST_URI']);
} elseif isset($error) {
?>
<div align="center">
<table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#666666">
<tr>
<td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Reactie posten:
</b></font>
</td>
</tr>
<tr>
<td height="23">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="97%">
<font face="Arial" color="red" size="-1"><b>Error:</b>
<?= $error; ?>
</font>
</td>
<td width="3%">
<div align="right">
<input onClick="javascript:history.go(-1);" type="button" name="Button" value="Terug">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
}
} else {
if ($aantal != 0) {
?>
<hr width="89%" color="black">
<br>
<?php } ?>
<form method="post" action="">
<div align="center">
<table width="44%" border="1" cellpadding="2" cellspacing="1" bordercolor="#666666" bgcolor="#333333">
<tr bgcolor="#666666">
<td colspan="2"><b><font face="Verdana" size="-1">Reactie
posten:</font></b></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="60%"><font face="Verdana" size="-1">Je naam:</font></td>
<td width="40%">
<input type="text" name="naam" size="30">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="60%"><font face="Verdana" size="-1">Je e-mailadres:</font></td>
<td width="40%">
<input type="text" name="emailadres" size="30">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center"><font size="-1" face="Verdana">Je bericht: </font> </div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center">
<textarea name="berichtreactie" cols="50" rows="5"></textarea>
</div>
</td>
</tr>
<tr bgcolor="#999999">
<td colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Post reactie">
<input type="button" value="Terug naar nieuws" onClick="window.location='nieuws.php' " name="button">
</div>
</td>
</tr>
</table>
</div>
</form>
<?php } ?>
<?php include ('config.php'); $nieuwsid=$_GET['nieuwsid']; $bericht = nl2br($bericht); $bericht = wordwrap($bericht, 60, "\n", 1 ); ?> <div align="center"> <table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000"> <tr bgcolor="#999999"> <td width="35%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Onderwerp:</b> <?= $obj->onderwerp; ?></font></td> <td width="29%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost door:</b> <?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\"> ".$obj->naam."</font></a>"; ?></font></td> <td width="36%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost op:</b> <?= $obj->datum; ?></font></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="3"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><?= $bericht; ?> </font></td> </tr> </table> </div> <br> <hr width="89%" color="black"> <br> <?php $bericht = nl2br($bericht); $bericht = wordwrap($bericht, 60, "\n", 1 ); if ($aantal > 0) { ?> <div align="center"> <table width="89%" border="1" cellspacing="1" cellpadding="2" bordercolor="#666666" bgcolor="#000000"> <tr bgcolor="#999999"> <td width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost door:</b> <?php echo"<a href=mailto:".$obj->emailadres."><font color=\"#000080\"> ".$obj->naam."</font></a>"; ?> </font></td> <td width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Gepost op:</b> <?php echo $obj->datum." - ".$obj->tijd; ?> </font></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1"> <?= $bericht; ?> </font></td> </tr> </table> </div> <br> <?php } } ?> <?php if (isset($_POST['Submit'])) { if (!isset($_POST['berichtreactie'])) $error = "Je moet een bericht invullen"; if (!isset($_POST['emailadres'])) $error = "Je moet je e-mailadres invullen"; if (!isset($_POST['naam'])) $error = "Je moet je naam invullen"; if (!$error) { $query ="INSERT INTO nieuwscomments (naam, tijd, datum, bericht, nieuwsid, emailadres) VALUES ('".$_POST['naam']."', '".$_POST['tijd']."', '".$_POST['datum']."', '".$_POST['berichtreactie']."', '".$_POST['nieuwsid']."', '".$_POST['emailadres']."')"; header("location:".$_SERVER['REQUEST_URI']); ?> <div align="center"> <table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#666666"> <tr> <td height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Reactie posten: </b></font> </td> </tr> <tr> <td height="23"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="97%"> <font face="Arial" color="red" size="-1"><b>Error:</b> <?= $error; ?> </font> </td> <td width="3%"> <div align="right"> <input onClick="javascript:history.go(-1);" type="button" name="Button" value="Terug"> </div> </td> </tr> </table> </td> </tr> </table> </div> <?php } } else { if ($aantal != 0) { ?> <hr width="89%" color="black"> <br> <?php } ?> <form method="post" action=""> <div align="center"> <table width="44%" border="1" cellpadding="2" cellspacing="1" bordercolor="#666666" bgcolor="#333333"> <tr bgcolor="#666666"> <td colspan="2"><b><font face="Verdana" size="-1">Reactie posten:</font></b></td> </tr> <tr bgcolor="#CCCCCC"> <td width="60%"><font face="Verdana" size="-1">Je naam:</font></td> <td width="40%"> <input type="text" name="naam" size="30"> </td> </tr> <tr bgcolor="#CCCCCC"> <td width="60%"><font face="Verdana" size="-1">Je e-mailadres:</font></td> <td width="40%"> <input type="text" name="emailadres" size="30"> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"><font size="-1" face="Verdana">Je bericht: </font> </div> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"> <textarea name="berichtreactie" cols="50" rows="5"></textarea> </div> </td> </tr> <tr bgcolor="#999999"> <td colspan="2"> <div align="center"> <input type="submit" name="Submit" value="Post reactie"> <input type="button" value="Terug naar nieuws" onClick="window.location='nieuws.php' " name="button"> </div> </td> </tr> </table> </div> </form> <?php } ?>
###################
Nieuwstoevoegen.php
###################
<?php
include ('config.php');
$arraymaand = array("Januari","Februari","Maart","April","Mei","Juni",
"Juli","Augustus","September","Oktober","November","December");
$maand = date("n") - 1;
$datum = date("j ") . $arraymaand[$maand] . date(" Y");
if (isset($_POST['submit'])) {
if (!isset($bericht))
$error="Je moet een bericht invullen!";
if (!isset($naam))
$error="Je moet je naam invullen!";
if (!isset($emailadres))
$error="Je moet je e-mailadres invullen!";
if (!isset($onderwerp))
$error="Je moet een onderwerp invullen!";
if (!isset($error)) {
mysql_query("INSERT INTO nieuws (datum,bericht,emailadres,onderwerp,naam) VALUES
('".$_POST['datum']."','".$_POST['bericht']."','".$_POST['emailadres']."',
'".$_POST['onderwerp']."','".$_POST['naam']."')") or die (mysql_error());
?>
<div align="center">
<table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr>
<td height="22" bgcolor="#999999"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws
toevoegen: </b></font></td>
</tr>
<tr>
<td height="46" bgcolor="#CCCCCC">
<div align="left"><font face="Arial, Helvetica, sans-serif" size="-1">Het
nieuws is <b>succesvol</b> toegevoegd!</font></div>
</td>
</tr>
<tr>
<td height="21" bgcolor="#999999">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[
Terug naar <a href="nieuws.php">nieuws</a> ]</font></div>
</td>
</tr>
</table>
</div>
<?php
} elseif isset($error)) {
?>
<div align="center">
<table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr>
<td height="22" bgcolor="#999999"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws
toevoegen: </b></font> </td>
</tr>
<tr>
<td height="23" bgcolor="#CCCCCC">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="97%">
<font face="Arial" color="red" size="-1"><b>Error:</b>
<?= $error; ?>
</font>
</td>
<td width="3%">
<div align="right">
<input onClick="javascript:history.go(-1);" type="button" name="Button" value="Terug">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php
}
} else {
?>
<form action="" method="post">
<div align="center">
<table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws
toevoegen: </b></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Je naam: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="naam" size="30">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif">
</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je
e-mailadres: </font><font face="Verdana, Arial, Helvetica, sans-serif">
</font></font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="emailadres" size="30">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Het
onderwerp: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="onderwerp" size="30">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center"><font face="Verdana, Arial, Helvetica,
sans-serif" size="-1">Bericht: </font><font size="-1"
face="Verdana, Arial, Helvetica, sans-serif"> </font></div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif">
</font></font><font face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="bericht" cols="50" rows="20" wrap="VIRTUAL"></textarea>
</font></font></div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"> </td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="20">
<div align="center">
<input type="submit" value="Post nieuws" name="submit">
<input type="reset" value="Wis velden" name="reset">
<input type="button" value="Terug naar nieuws"
onClick="window.location='nieuws.php' " name="button">
</div>
</td>
</tr>
</table>
</div>
</form>
<?php } ?>
<?php include ('config.php'); $arraymaand = array("Januari","Februari","Maart","April","Mei","Juni", "Juli","Augustus","September","Oktober","November","December"); $datum = date("j ") . $arraymaand[$maand] . date(" Y"); if (isset($_POST['submit'])) { $error="Je moet een bericht invullen!"; $error="Je moet je naam invullen!"; $error="Je moet je e-mailadres invullen!"; $error="Je moet een onderwerp invullen!"; mysql_query("INSERT INTO nieuws (datum,bericht,emailadres,onderwerp,naam) VALUES ('".$_POST['datum']."','".$_POST['bericht']."','".$_POST['emailadres']."', '".$_POST['onderwerp']."','".$_POST['naam']."')") or die (mysql_error()); ?> <div align="center"> <table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr> <td height="22" bgcolor="#999999"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws toevoegen: </b></font></td> </tr> <tr> <td height="46" bgcolor="#CCCCCC"> <div align="left"><font face="Arial, Helvetica, sans-serif" size="-1">Het nieuws is <b>succesvol</b> toegevoegd!</font></div> </td> </tr> <tr> <td height="21" bgcolor="#999999"> <div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug naar <a href="nieuws.php">nieuws</a> ]</font></div> </td> </tr> </table> </div> <?php } elseif isset($error)) { ?> <div align="center"> <table width="39%" border="1" cellspacing="3" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr> <td height="22" bgcolor="#999999"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws toevoegen: </b></font> </td> </tr> <tr> <td height="23" bgcolor="#CCCCCC"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="97%"> <font face="Arial" color="red" size="-1"><b>Error:</b> <?= $error; ?> </font> </td> <td width="3%"> <div align="right"> <input onClick="javascript:history.go(-1);" type="button" name="Button" value="Terug"> </div> </td> </tr> </table> </td> </tr> </table> </div> <?php } } else { ?> <form action="" method="post"> <div align="center"> <table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr bgcolor="#999999"> <td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws toevoegen: </b></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je naam: </font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="naam" size="30"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif"> </font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je e-mailadres: </font><font face="Verdana, Arial, Helvetica, sans-serif"> </font></font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="emailadres" size="30"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Het onderwerp: </font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="onderwerp" size="30"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Bericht: </font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif"> </font></font><font face="Verdana, Arial, Helvetica, sans-serif"> <textarea name="bericht" cols="50" rows="20" wrap="VIRTUAL"></textarea> </font></font></div> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> </td> </tr> <tr bgcolor="#999999"> <td colspan="2" height="20"> <div align="center"> <input type="submit" value="Post nieuws" name="submit"> <input type="reset" value="Wis velden" name="reset"> <input type="button" value="Terug naar nieuws" onClick="window.location='nieuws.php' " name="button"> </div> </td> </tr> </table> </div> </form> <?php } ?>
#########
Admin.php
#########
<div align="center">
<table width="89%" border="1" cellspacing="2" cellpadding="2"
bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="3"><font face="Verdana" size="-1"><b>Admin
pagina:</b></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="5%">
<div align="center"><font face="Verdana" size="-1"><b>Id:</b></font></div>
</td>
<td width="56%">
<div align="center"><font size="-1" face="Verdana"><b>Onderwerp:</b></font></div>
</td>
<td width="39%">
<div align="center"><font size="-1" face="Verdana"><b>Opties:</b></font></div>
</td>
</tr>
<?php
include ('config.php');
$query = "SELECT * FROM nieuws ORDER BY id DESC";
$resultaat = mysql_query($query) or die (mysql_error());
while ($rij = mysql_fetch_object($resultaat)){
echo "
<tr bgcolor=\"#E2E2E2\">
<td width=\"3%\">
<div align=\"center\"> <font face=\"Verdana, Arial,
Helvetica, sans-serif\" size=\"-1\">".$rij->id."</font></div>
</td><td width=\"58%\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica,
sans-serif\" size=\"-1\"> ".$rij->onderwerp."</font></div>
</td><td width=\"39%\">
<div align=\"center\"><font face=\"Verdana, Arial, Helvetica,
sans-serif\" size=\"-1\">
[<a href=\"verandernieuws.php?id=".$rij->id."\">Verander</a>]
[<a href=\"verwijdernieuws.php?id=".$rij->id."\">Verwijder</a>]
</font></div></td></tr>
";} ?>
</table>
</div>
<div align="center"> <table width="89%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr bgcolor="#999999"> <td colspan="3"><font face="Verdana" size="-1"><b>Admin pagina:</b></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="5%"> <div align="center"><font face="Verdana" size="-1"><b>Id:</b></font></div> </td> <td width="56%"> <div align="center"><font size="-1" face="Verdana"><b>Onderwerp:</b></font></div> </td> <td width="39%"> <div align="center"><font size="-1" face="Verdana"><b>Opties:</b></font></div> </td> </tr> <?php include ('config.php'); $query = "SELECT * FROM nieuws ORDER BY id DESC"; <tr bgcolor=\"#E2E2E2\"> <td width=\"3%\"> <div align=\"center\"> <font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\">".$rij->id."</font></div> </td><td width=\"58%\"> <div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\"> ".$rij->onderwerp."</font></div> </td><td width=\"39%\"> <div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\"> [<a href=\"verandernieuws.php?id=".$rij->id."\">Verander</a>] [<a href=\"verwijdernieuws.php?id=".$rij->id."\">Verwijder</a>] </font></div></td></tr> ";} ?> </table> </div>
##################
Verandernieuws.php
##################
<?php
include ('config.php');
if (isset($_POST['Veranderen'])) {
if (!isset($_POST['bericht']))
$error="Het bericht mag niet leeg zijn";
if (!isset($_POST['naam']))
$error="De naam mag niet leeg zijn";
if (!isset($_POST['emailadres']))
$error="Het e-mailadres mag niet leeg zijn";
if (!isset($error)) {
$query = "UPDATE nieuws SET naam='".$_POST['naam']."', bericht='".$_POST['bericht']."',
emailadres='".$_POST['emailadres']."', onderwerp='".$_POST['onderwerp']."' WHERE id = ".$_GET['id'];
mysql_query($query) or die (mysql_error());
?>
<div align="center">
<table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws
veranderen: </b></font></td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="68" bgcolor="#CCCCCC">
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Het
nieuws is succesvol veranderd<br>
</font>
<hr color="black">
<font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug
naar <a href="admin.php">admin pagina</a> ]<br>
[ Terug naar <a href="nieuws.php">nieuws</a> ] </font></div>
</td>
</tr>
</table>
</div>
<?php
} elseif ($error) {
echo"
<div align=\"center\"><table width=\"50%\" border=\"1\"
cellspacing=\"0\" cellpadding=\"2\">
<tr bordercolor=\"#000000\">
<td bordercolor=\"#000000\" bgcolor=\"#CCCCCC\" height=\"36\">
<div align=\"center\"><font color=\"#000000\" face=\"Verdana,
Arial, Helvetica, sans-serif\" size=\"-1\"><div align=center>
<font color=black size=-1 face=verdana><b>".$error."</b><br>
</font></div></font></div>
<form method=\"post\" action=\"javascript:history.go(-1)\">
<div align=center><input type=\"submit\" name=\"Terug\"
value=\"Terug\"></div>
</form></td></tr></table></div>
";
}
} else {
$query = "SELECT * FROM nieuws WHERE id = ".$_GET['id'];
$resultaat = mysql_query($query) or die (mysql_error());
while ($obj = mysql_fetch_object($resultaat)) {
$v_bericht = $obj->bericht;
$v_naam = $obj->naam;
$v_emailadres= $obj->emailadres;
$v_onderwerp= $obj->onderwerp;
?>
<form action="" method="post">
<div align="center">
<table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws
veranderen: </b></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica,
sans-serif">Je naam: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="naam" size="30" value="<?= $v_naam; ?>">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif">
</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je
e-mailadres: </font><font face="Verdana, Arial, Helvetica, sans-serif">
</font></font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="emailadres" size="30" value="<?= $v_emailadres; ?>">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="58%">
<div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Het
onderwerp: </font></div>
</td>
<td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="onderwerp" size="30" value="<?= $v_onderwerp; ?>">
</font></font></font></td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Bericht: </font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2">
<div align="center"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif">
</font></font><font face="Verdana, Arial, Helvetica, sans-serif">
<textarea name="bericht" cols="50" rows="20" wrap="VIRTUAL"><?= $v_bericht; ?></textarea>
</font></font></div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td colspan="2"> </td>
</tr>
<tr bgcolor="#999999">
<td colspan="2" height="20">
<div align="center">
<input type="submit" value="Verander nieuws" name="Veranderen">
<input type="button" value="Terug naar admin" onClick="window.location='admin.php'" name="button">
</div>
</td>
</tr>
</table>
</div>
</form>
<?php
}
}
?>
<?php include ('config.php'); if (isset($_POST['Veranderen'])) { if (!isset($_POST['bericht'])) $error="Het bericht mag niet leeg zijn"; if (!isset($_POST['naam'])) $error="De naam mag niet leeg zijn"; if (!isset($_POST['emailadres'])) $error="Het e-mailadres mag niet leeg zijn"; $query = "UPDATE nieuws SET naam='".$_POST['naam']."', bericht='".$_POST['bericht']."', emailadres='".$_POST['emailadres']."', onderwerp='".$_POST['onderwerp']."' WHERE id = ".$_GET['id']; ?> <div align="center"> <table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr bgcolor="#999999"> <td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws veranderen: </b></font></td> </tr> <tr bgcolor="#999999"> <td colspan="2" height="68" bgcolor="#CCCCCC"> <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Het nieuws is succesvol veranderd<br> </font> <hr color="black"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug naar <a href="admin.php">admin pagina</a> ]<br> [ Terug naar <a href="nieuws.php">nieuws</a> ] </font></div> </td> </tr> </table> </div> <?php } elseif ($error) { <div align=\"center\"><table width=\"50%\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\"> <tr bordercolor=\"#000000\"> <td bordercolor=\"#000000\" bgcolor=\"#CCCCCC\" height=\"36\"> <div align=\"center\"><font color=\"#000000\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"-1\"><div align=center> <font color=black size=-1 face=verdana><b>".$error."</b><br> </font></div></font></div> <form method=\"post\" action=\"javascript:history.go(-1)\"> <div align=center><input type=\"submit\" name=\"Terug\" value=\"Terug\"></div> </form></td></tr></table></div> "; } } else { $query = "SELECT * FROM nieuws WHERE id = ".$_GET['id']; $v_bericht = $obj->bericht; $v_naam = $obj->naam; $v_emailadres= $obj->emailadres; $v_onderwerp= $obj->onderwerp; ?> <form action="" method="post"> <div align="center"> <table width="39%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr bgcolor="#999999"> <td colspan="2" height="22"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Nieuws veranderen: </b></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je naam: </font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="naam" size="30" value="<?= $v_naam; ?>"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif"> </font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Je e-mailadres: </font><font face="Verdana, Arial, Helvetica, sans-serif"> </font></font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="emailadres" size="30" value="<?= $v_emailadres; ?>"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td width="58%"> <div align="left"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Het onderwerp: </font></div> </td> <td width="42%"><font size="-1"><font size="-1"><font face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="onderwerp" size="30" value="<?= $v_onderwerp; ?>"> </font></font></font></td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">Bericht: </font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> <div align="center"><font size="-1"><font size="-1"> <font face="Verdana, Arial, Helvetica, sans-serif"> </font></font><font face="Verdana, Arial, Helvetica, sans-serif"> <textarea name="bericht" cols="50" rows="20" wrap="VIRTUAL"><?= $v_bericht; ?></textarea> </font></font></div> </td> </tr> <tr bgcolor="#CCCCCC"> <td colspan="2"> </td> </tr> <tr bgcolor="#999999"> <td colspan="2" height="20"> <div align="center"> <input type="submit" value="Verander nieuws" name="Veranderen"> <input type="button" value="Terug naar admin" onClick="window.location='admin.php'" name="button"> </div> </td> </tr> </table> </div> </form> <?php } } ?>
###################
Verwijdernieuws.php
###################
<?php
if (!isset($_POST['Ja'])) {
?>
<div align="center">
<table width="50%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666">
<tr bgcolor="#999999">
<td colspan="2" height="43">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Ben
je zeker dat je het nieuws wilt verwijderen ?</b></font></div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td valign="middle" width="50%" height="75">
<div align="center">
<form action="admin.php" method="post">
<input type="submit" name="Neen" value="Neen, ik wil het niet verwijderen">
</form>
</div>
</td>
<td valign="middle" width="50%" height="75">
<div align="center">
<form action="" method="post">
<input type="submit" name="Ja" value="Ja, ik wil het verwijderen">
</form>
</div>
</td>
</tr>
<tr valign="bottom" bgcolor="#999999">
<td width="50%" height="33"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">[
Terug naar <a href="admin.php">admin</a> pagina ]</font></td>
<td width="50%" height="33">
<div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">[
Terug naar <a href="nieuws.php">nieuws</a> pagina ]</font></div>
</td>
</tr>
</table>
</div>
<?php
}
elseif (isset($_POST['Ja'])) {
include ('config.php');
mysql_query("DELETE FROM nieuws WHERE id = ".$_GET['id']) or die (mysql_error());
mysql_query("DELETE FROM nieuwscomments WHERE nieuwsid=".$_GET['id']) or die (mysql_error());
?>
<div align="center">
<table width="50%" border="1" cellspacing="2" cellpadding="2" bgcolor="#666666" bordercolor="#999999">
<tr bgcolor="#999999">
<td colspan="2" height="43">
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Het
nieuws is succesvol verwijderd !</b></font></div>
</td>
</tr>
<tr valign="bottom" bgcolor="#CCCCCC">
<td width="50%" height="33"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[
Terug naar <a href="admin.php">admin</a> pagina ]</font></td>
<td width="50%" height="33">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[
Terug naar <a href="nieuws.php">nieuws</a> pagina ]</font></div>
</td>
</tr>
</table>
</div>
<?php } ?>
<?php if (!isset($_POST['Ja'])) { ?> <div align="center"> <table width="50%" border="1" cellspacing="2" cellpadding="2" bordercolor="#999999" bgcolor="#666666"> <tr bgcolor="#999999"> <td colspan="2" height="43"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Ben je zeker dat je het nieuws wilt verwijderen ?</b></font></div> </td> </tr> <tr bgcolor="#CCCCCC"> <td valign="middle" width="50%" height="75"> <div align="center"> <form action="admin.php" method="post"> <input type="submit" name="Neen" value="Neen, ik wil het niet verwijderen"> </form> </div> </td> <td valign="middle" width="50%" height="75"> <div align="center"> <form action="" method="post"> <input type="submit" name="Ja" value="Ja, ik wil het verwijderen"> </form> </div> </td> </tr> <tr valign="bottom" bgcolor="#999999"> <td width="50%" height="33"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">[ Terug naar <a href="admin.php">admin</a> pagina ]</font></td> <td width="50%" height="33"> <div align="right"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">[ Terug naar <a href="nieuws.php">nieuws</a> pagina ]</font></div> </td> </tr> </table> </div> <?php } elseif (isset($_POST['Ja'])) { include ('config.php'); ?> <div align="center"> <table width="50%" border="1" cellspacing="2" cellpadding="2" bgcolor="#666666" bordercolor="#999999"> <tr bgcolor="#999999"> <td colspan="2" height="43"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b>Het nieuws is succesvol verwijderd !</b></font></div> </td> </tr> <tr valign="bottom" bgcolor="#CCCCCC"> <td width="50%" height="33"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug naar <a href="admin.php">admin</a> pagina ]</font></td> <td width="50%" height="33"> <div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">[ Terug naar <a href="nieuws.php">nieuws</a> pagina ]</font></div> </td> </tr> </table> </div> <?php } ?>
Download code (.txt)
|
|
Stemmen |
Niet ingelogd. |
|