Nieuw lid |
|
Heej,
Ik zit met een probleem... Ik slaag er maar niet in om mijn reactie-pagina te koppelen aan mijn index... Kan iemand mij misschien helpen? Hier alvast de reactie-pagina.
<?php
require_once("database.inc.php");
function date_format($tijd, $jaar = false)
{
$dagen_array = array("Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag");
$maand_array = array("Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December");
if(!$jaar)
$datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)];
else
$datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)] . " " . date("Y", $tijd);
return $datum;
}
$tijd = time();
$datum = date_format($tijd);
$ip = $REMOTE_ADDR;
echo "<title>". $main_title ."</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"images/style.css\">";
// *** QUICK REPLY *** //
if($_POST['quickreply']) {
if($_POST['naam'] == "" | $_POST['reactie'] == "") {
// Tabel
echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
echo "<center>\n";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\">";
echo "Je moet de velden Naam en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>";
echo "</td>\n";
echo "</tr>\n\n";
// Einde Tabel
echo "</table>\n<br />";
if($copy_on == 1) {
echo $copyright;
} else {
}
echo "</center>";
exit;
} else {
mysql_query ("INSERT INTO reacties (id,nid,naam,email,website,reactie,datum,ip) VALUES ('','".$_GET["nid"]."','".$_POST["naam"]."','Niet Ingevult','','". $_POST['reactie'] ."','". $datum ."','". $ip ."')") or die (mysql_error ());
echo "<meta http-equiv=\"refresh\" content=\"0;URL=?pagina=nieuwssysteem/index.php\">";
}
}
// *** REACTIE PLAATSEN *** //
if (isset($_GET["nid"]) && is_numeric($_GET["nid"])) {
if($_POST['submit']) {
if($_POST['naam'] == "" | $_POST['email'] == "" | $_POST['reactie'] == "") {
// Tabel
echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
echo "<center>\n";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\">";
echo "Je moet de velden Naam, Email en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>";
echo "</td>\n";
echo "</tr>\n\n";
// Einde Tabel
echo "</table>\n";
if($copy_on == 1) {
echo $copyright;
} else {
}
echo "</center>";
} else {
mysql_query ("INSERT INTO reacties (id,nid,naam,email,website,reactie,datum,ip) VALUES ('','".$_GET["nid"]."','".$_POST["naam"]."','". $_POST['email'] . "','".$_POST["website"]."','". $_POST['reactie'] ."','". $datum ."','". $ip ."')") or die (mysql_error ());
echo "<meta http-equiv='refresh' content='0;URL=?pagina=nieuwssysteem\index'>";
}
}
elseif($reactie == "lezen") {
// Gegevens uit de database ophalen
$select = "SELECT * FROM reacties WHERE nid='". $_GET['nid'] ."'";
$sql = mysql_query($select) or die(mysql_error());
echo "<center>";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Navigatie</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\">";
echo "<A HREF=\"?pagina=nieuwssysteem\index\">Nieuws index</A>";
echo "</td>\n";
echo "</tr>\n\n";
echo "</table>\n<br>";
echo "</center>";
// Gegevens laten zien met een while
while($GET = mysql_fetch_assoc($sql))
{
// Listing in Tabel
echo "<center>\n";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Reactie</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\"><b>Naam:</b> <a href=\"mailto:". htmlspecialchars($GET['email']) ."\">". htmlspecialchars($GET['naam']) ."</a> (<a href=\"". htmlspecialchars($GET['website']) ."\">www</a>) <b>Geplaatst op</b>: ". htmlspecialchars($GET['datum']) ."<hr color=\"#657687\" size=\"0\">". url(smilies(nl2br(htmlspecialchars($GET['reactie'])))) ."</td>\n";
echo "<tr class=\"list0\">\n";
echo "<td class=\"list0\" width=\"100%\"><a href=\"?pagina=nieuwssysteem/reactie&reactie=plaatsen&nid=". $_GET['nid'] ."\">Reageren</a></td>\n";
echo "</tr>\n\n";
echo "</table>\n<br>";
echo "</center>";
}
// Snel reageren
echo "<center>\n";
echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Snel Reageren</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\">";
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"100%\"><input type=\"text\" value=\"Naam\" name=\"naam\" size=\"20\"><br /><textarea rows=\"5\" name=\"reactie\" cols=\"50\"></textarea></td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"100%\"><input type=\"submit\" value=\"Reageren\" name=\"quickreply\"></td>";
echo "</tr>";
echo "</table>";
echo "</td>\n";
echo "</tr>\n\n";
echo "</table>\n<br>";
echo "</form>";
if($copy_on == 1) {
echo $copyright;
} else {
}
echo "</center>";
} else {
// Tabel
echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
echo "<center>\n";
echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
echo "<tr>\n";
echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
echo "<b>Reactie plaatsen:</b></td></tr>\n\n";
echo "<tr class=\"list1\">\n";
echo "<td class=\"list1\" width=\"100%\">";
echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n";
echo "<input type=hidden name=plaatsen value=1>\n";
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
echo "<tr>\n";
echo "<td width=\"100%\" colspan=\"2\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"50%\">Naam:</td>\n";
echo "<td width=\"50%\"><input type=\"text\" name=\"naam\" size=\"20\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"50%\">Email:</td>\n";
echo "<td width=\"50%\"><input type=\"text\" name=\"email\" size=\"20\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"50%\">Website:</td>\n";
echo "<td width=\"50%\"><input type=\"text\" name=\"website\" size=\"20\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"50%\">Reactie:</td>\n";
echo "<td width=\"50%\">\n";
// BB Buttons
echo "<input type=\"button\" value=\"B\" style=\"font-weight:bold; width: 30px\" onClick=\"javascript:addtext('reactie','[b] [/b]')\">\n";
echo "<input type=\"button\" value=\"i\" style=\"font-style:italic; width: 30px\" onClick=\"javascript:addtext('reactie','[i] [/i]')\">\n";
echo "<input type=\"button\" value=\"u\" style=\"text-decoration: underline; width: 30px\" onClick=\"javascript:addtext('reactie','[u] [/u]')\">\n";
echo "<input type=\"button\" value=\"Link\" onClick=\"javascript:addtext('reactie','[url=] [/url]')\">\n";
echo "<input type=\"button\" value=\"Figuur\" onClick=\"javascript:addtext('reactie','[img] [/img]')\">\n";
echo "<br><textarea rows=\"13\" name=\"reactie\" cols=\"41\"></textarea></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"50%\"> </td>\n";
echo "<td width=\"50%\">\n";
// Smilies
echo "<a href=\"javascript:addtext('reactie',':)')\"><img border=\"0\" src=\"images/smilies/icon_razz.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':D')\"><img border=\"0\" src=\"images/smilies/icon_biggrin.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':B')\"><img border=\"0\" src=\"images/smilies/icon_cool.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':S')\"><img border=\"0\" src=\"images/smilies/icon_confused.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':(')\"><img border=\"0\" src=\"images/smilies/icon_cry.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':|')\"><img border=\"0\" src=\"images/smilies/icon_neutral.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<a href=\"javascript:addtext('reactie',':O')\"><img border=\"0\" src=\"images/smilies/icon_eek.gif\" width=\"15\" height=\"15\"></a>\n";
echo "<br><input type=\"submit\" value=\"Reageren\" name=\"submit\"></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td width=\"100%\" colspan=\"2\"><a href=\"?pagina=home\">Ga terug</a></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
echo "</td>\n";
echo "</tr>\n\n";
// Einde Tabel
echo "</table><br>\n";
if($copy_on == 1) {
echo $copyright;
} else {
}
echo "</center>";
}
}
?>
<?php require_once("database.inc.php"); function date_format($tijd, $jaar = false) { $dagen_array = array("Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag"); $maand_array = array("Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"); if(!$jaar) $datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)]; else $datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)] . " " . date("Y", $tijd); return $datum; } $datum = date_format($tijd); $ip = $REMOTE_ADDR; echo "<title>". $main_title ."</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"images/style.css\">"; // *** QUICK REPLY *** // if($_POST['quickreply']) { if($_POST['naam'] == "" | $_POST['reactie'] == "") { // Tabel echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>"; echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<td class=\"list1\" width=\"100%\">"; echo "Je moet de velden Naam en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>"; // Einde Tabel if($copy_on == 1) { } else { } } else { mysql_query ("INSERT INTO reacties (id,nid,naam,email,website,reactie,datum,ip) VALUES ('','".$_GET["nid"]."','".$_POST["naam"]."','Niet Ingevult','','". $_POST['reactie'] ."','". $datum ."','". $ip ."')") or die (mysql_error ()); echo "<meta http-equiv=\"refresh\" content=\"0;URL=?pagina=nieuwssysteem/index.php\">"; } } // *** REACTIE PLAATSEN *** // if($_POST['submit']) { if($_POST['naam'] == "" | $_POST['email'] == "" | $_POST['reactie'] == "") { // Tabel echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>"; echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<td class=\"list1\" width=\"100%\">"; echo "Je moet de velden Naam, Email en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>"; // Einde Tabel if($copy_on == 1) { } else { } } else { mysql_query ("INSERT INTO reacties (id,nid,naam,email,website,reactie,datum,ip) VALUES ('','".$_GET["nid"]."','".$_POST["naam"]."','". $_POST['email'] . "','".$_POST["website"]."','". $_POST['reactie'] ."','". $datum ."','". $ip ."')") or die (mysql_error ()); echo "<meta http-equiv='refresh' content='0;URL=?pagina=nieuwssysteem\index'>"; } } elseif($reactie == "lezen") { // Gegevens uit de database ophalen $select = "SELECT * FROM reacties WHERE nid='". $_GET['nid'] ."'"; echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Navigatie</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<td class=\"list1\" width=\"100%\">"; echo "<A HREF=\"?pagina=nieuwssysteem\index\">Nieuws index</A>"; // Gegevens laten zien met een while { // Listing in Tabel echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Reactie</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<tr class=\"list0\">\n"; echo "<td class=\"list0\" width=\"100%\"><a href=\"?pagina=nieuwssysteem/reactie&reactie=plaatsen&nid=". $_GET['nid'] ."\">Reageren</a></td>\n"; } // Snel reageren echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n"; echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Snel Reageren</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<td class=\"list1\" width=\"100%\">"; echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">"; echo "<td width=\"100%\"><input type=\"text\" value=\"Naam\" name=\"naam\" size=\"20\"><br /><textarea rows=\"5\" name=\"reactie\" cols=\"50\"></textarea></td>"; echo "<td width=\"100%\"><input type=\"submit\" value=\"Reageren\" name=\"quickreply\"></td>"; if($copy_on == 1) { } else { } } else { // Tabel echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>"; echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n"; echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n"; echo "<b>Reactie plaatsen:</b></td></tr>\n\n"; echo "<tr class=\"list1\">\n"; echo "<td class=\"list1\" width=\"100%\">"; echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n"; echo "<input type=hidden name=plaatsen value=1>\n"; echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n"; echo "<td width=\"100%\" colspan=\"2\"></td>\n"; echo "<td width=\"50%\">Naam:</td>\n"; echo "<td width=\"50%\"><input type=\"text\" name=\"naam\" size=\"20\"></td>\n"; echo "<td width=\"50%\">Email:</td>\n"; echo "<td width=\"50%\"><input type=\"text\" name=\"email\" size=\"20\"></td>\n"; echo "<td width=\"50%\">Website:</td>\n"; echo "<td width=\"50%\"><input type=\"text\" name=\"website\" size=\"20\"></td>\n"; echo "<td width=\"50%\">Reactie:</td>\n"; echo "<td width=\"50%\">\n"; // BB Buttons echo "<input type=\"button\" value=\"B\" style=\"font-weight:bold; width: 30px\" onClick=\"javascript:addtext('reactie','[b] [/b]')\">\n"; echo "<input type=\"button\" value=\"i\" style=\"font-style:italic; width: 30px\" onClick=\"javascript:addtext('reactie','[i] [/i]')\">\n"; echo "<input type=\"button\" value=\"u\" style=\"text-decoration: underline; width: 30px\" onClick=\"javascript:addtext('reactie','[u] [/u]')\">\n"; echo "<input type=\"button\" value=\"Link\" onClick=\"javascript:addtext('reactie','[url=] [/url]')\">\n"; echo "<input type=\"button\" value=\"Figuur\" onClick=\"javascript:addtext('reactie','[img] [/img]')\">\n"; echo "<br><textarea rows=\"13\" name=\"reactie\" cols=\"41\"></textarea></td>\n"; echo "<td width=\"50%\"> </td>\n"; echo "<td width=\"50%\">\n"; // Smilies echo "<a href=\"javascript:addtext('reactie',':)')\"><img border=\"0\" src=\"images/smilies/icon_razz.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':D')\"><img border=\"0\" src=\"images/smilies/icon_biggrin.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':B')\"><img border=\"0\" src=\"images/smilies/icon_cool.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':S')\"><img border=\"0\" src=\"images/smilies/icon_confused.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':(')\"><img border=\"0\" src=\"images/smilies/icon_cry.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':|')\"><img border=\"0\" src=\"images/smilies/icon_neutral.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<a href=\"javascript:addtext('reactie',':O')\"><img border=\"0\" src=\"images/smilies/icon_eek.gif\" width=\"15\" height=\"15\"></a>\n"; echo "<br><input type=\"submit\" value=\"Reageren\" name=\"submit\"></td>\n"; echo "<td width=\"100%\" colspan=\"2\"><a href=\"?pagina=home\">Ga terug</a></td>\n"; // Einde Tabel if($copy_on == 1) { } else { } } } ?>
Alvast bedankt,
Yannick
|