login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Nieuwssysteem

Offline YannickVDS - 09/04/2005 20:48 (laatste wijziging 09/04/2005 20:49)
Avatar van YannickVDSNieuw 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.
  1. <?php
  2. require_once("database.inc.php");
  3.  
  4. function date_format($tijd, $jaar = false)
  5. {
  6. $dagen_array = array("Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag");
  7. $maand_array = array("Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December");
  8.  
  9. if(!$jaar)
  10. $datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)];
  11. else
  12. $datum = $dagen_array[date("w", $tijd)] . " " . date("j", $tijd) . " " . $maand_array[(date("n", $tijd) - 1)] . " " . date("Y", $tijd);
  13.  
  14. return $datum;
  15. }
  16.  
  17. $tijd = time();
  18. $datum = date_format($tijd);
  19.  
  20. $ip = $REMOTE_ADDR;
  21.  
  22. echo "<title>". $main_title ."</title>";
  23. echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"images/style.css\">";
  24.  
  25. // *** QUICK REPLY *** //
  26. if($_POST['quickreply']) {
  27.  
  28. if($_POST['naam'] == "" | $_POST['reactie'] == "") {
  29. // Tabel
  30. echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
  31. echo "<center>\n";
  32. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  33. echo "<tr>\n";
  34. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  35.  
  36. echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n";
  37.  
  38. echo "<tr class=\"list1\">\n";
  39. echo "<td class=\"list1\" width=\"100%\">";
  40.  
  41. echo "Je moet de velden Naam en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>";
  42.  
  43. echo "</td>\n";
  44. echo "</tr>\n\n";
  45.  
  46. // Einde Tabel
  47. echo "</table>\n<br />";
  48.  
  49. if($copy_on == 1) {
  50. echo $copyright;
  51. } else {
  52. }
  53.  
  54. echo "</center>";
  55. } else {
  56.  
  57. 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 ());
  58. echo "<meta http-equiv=\"refresh\" content=\"0;URL=?pagina=nieuwssysteem/index.php\">";
  59. }
  60. }
  61.  
  62. // *** REACTIE PLAATSEN *** //
  63. if (isset($_GET["nid"]) && is_numeric($_GET["nid"])) {
  64.  
  65. if($_POST['submit']) {
  66.  
  67. if($_POST['naam'] == "" | $_POST['email'] == "" | $_POST['reactie'] == "") {
  68.  
  69. // Tabel
  70. echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
  71. echo "<center>\n";
  72. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  73. echo "<tr>\n";
  74. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  75.  
  76. echo "<b>Reactie plaatsen » Fout:</b></td></tr>\n\n";
  77.  
  78. echo "<tr class=\"list1\">\n";
  79. echo "<td class=\"list1\" width=\"100%\">";
  80.  
  81. echo "Je moet de velden Naam, Email en Reactie verplicht invullen! <a href=?pagina=home>Ga terug</a>";
  82.  
  83. echo "</td>\n";
  84. echo "</tr>\n\n";
  85.  
  86. // Einde Tabel
  87. echo "</table>\n";
  88.  
  89. if($copy_on == 1) {
  90. echo $copyright;
  91. } else {
  92. }
  93.  
  94. echo "</center>";
  95.  
  96. } else {
  97.  
  98. 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 ());
  99.  
  100. echo "<meta http-equiv='refresh' content='0;URL=?pagina=nieuwssysteem\index'>";
  101.  
  102. }
  103.  
  104. }
  105.  
  106. elseif($reactie == "lezen") {
  107.  
  108. // Gegevens uit de database ophalen
  109. $select = "SELECT * FROM reacties WHERE nid='". $_GET['nid'] ."'";
  110. $sql = mysql_query($select) or die(mysql_error());
  111.  
  112. echo "<center>";
  113. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  114. echo "<tr>\n";
  115. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  116.  
  117. echo "<b>Navigatie</b></td></tr>\n\n";
  118.  
  119. echo "<tr class=\"list1\">\n";
  120. echo "<td class=\"list1\" width=\"100%\">";
  121. echo "<A HREF=\"?pagina=nieuwssysteem\index\">Nieuws index</A>";
  122. echo "</td>\n";
  123. echo "</tr>\n\n";
  124.  
  125. echo "</table>\n<br>";
  126. echo "</center>";
  127.  
  128. // Gegevens laten zien met een while
  129. while($GET = mysql_fetch_assoc($sql))
  130. {
  131. // Listing in Tabel
  132. echo "<center>\n";
  133.  
  134. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  135. echo "<tr>\n";
  136. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  137.  
  138. echo "<b>Reactie</b></td></tr>\n\n";
  139.  
  140. echo "<tr class=\"list1\">\n";
  141. 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";
  142. echo "<tr class=\"list0\">\n";
  143. echo "<td class=\"list0\" width=\"100%\"><a href=\"?pagina=nieuwssysteem/reactie&reactie=plaatsen&nid=". $_GET['nid'] ."\">Reageren</a></td>\n";
  144. echo "</tr>\n\n";
  145.  
  146. echo "</table>\n<br>";
  147.  
  148. echo "</center>";
  149.  
  150. }
  151.  
  152. // Snel reageren
  153. echo "<center>\n";
  154. echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n";
  155. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  156. echo "<tr>\n";
  157. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  158.  
  159. echo "<b>Snel Reageren</b></td></tr>\n\n";
  160.  
  161. echo "<tr class=\"list1\">\n";
  162. echo "<td class=\"list1\" width=\"100%\">";
  163. echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">";
  164. echo "<tr>";
  165. echo "<td width=\"100%\"><input type=\"text\" value=\"Naam\" name=\"naam\" size=\"20\"><br /><textarea rows=\"5\" name=\"reactie\" cols=\"50\"></textarea></td>";
  166. echo "</tr>";
  167. echo "<tr>";
  168. echo "<td width=\"100%\"><input type=\"submit\" value=\"Reageren\" name=\"quickreply\"></td>";
  169. echo "</tr>";
  170. echo "</table>";
  171. echo "</td>\n";
  172. echo "</tr>\n\n";
  173.  
  174. echo "</table>\n<br>";
  175. echo "</form>";
  176.  
  177. if($copy_on == 1) {
  178. echo $copyright;
  179. } else {
  180. }
  181.  
  182. echo "</center>";
  183.  
  184. } else {
  185.  
  186. // Tabel
  187. echo "<script type=\"text/javascript\" src=\"images/javascript.js\"></script>";
  188. echo "<center>\n";
  189. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  190. echo "<tr>\n";
  191. echo "<td class=\"listtop\" colSpan=\"1\" width=\"100%\">\n\n";
  192.  
  193. echo "<b>Reactie plaatsen:</b></td></tr>\n\n";
  194.  
  195. echo "<tr class=\"list1\">\n";
  196. echo "<td class=\"list1\" width=\"100%\">";
  197.  
  198. echo "<form name=\"form\" method=\"POST\" action=\"?pagina=nieuwssysteem\index\">\n";
  199. echo "<input type=hidden name=plaatsen value=1>\n";
  200. echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
  201. echo "<tr>\n";
  202. echo "<td width=\"100%\" colspan=\"2\"></td>\n";
  203. echo "</tr>\n";
  204. echo "<tr>\n";
  205. echo "<td width=\"50%\">Naam:</td>\n";
  206. echo "<td width=\"50%\"><input type=\"text\" name=\"naam\" size=\"20\"></td>\n";
  207. echo "</tr>\n";
  208. echo "<tr>\n";
  209. echo "<td width=\"50%\">Email:</td>\n";
  210. echo "<td width=\"50%\"><input type=\"text\" name=\"email\" size=\"20\"></td>\n";
  211. echo "</tr>\n";
  212. echo "<tr>\n";
  213. echo "<td width=\"50%\">Website:</td>\n";
  214. echo "<td width=\"50%\"><input type=\"text\" name=\"website\" size=\"20\"></td>\n";
  215. echo "</tr>\n";
  216. echo "<tr>\n";
  217. echo "<td width=\"50%\">Reactie:</td>\n";
  218. echo "<td width=\"50%\">\n";
  219.  
  220. // BB Buttons
  221. echo "<input type=\"button\" value=\"B\" style=\"font-weight:bold; width: 30px\" onClick=\"javascript:addtext('reactie','[b] [/b]')\">\n";
  222. echo "<input type=\"button\" value=\"i\" style=\"font-style:italic; width: 30px\" onClick=\"javascript:addtext('reactie','[i] [/i]')\">\n";
  223. echo "<input type=\"button\" value=\"u\" style=\"text-decoration: underline; width: 30px\" onClick=\"javascript:addtext('reactie','[u] [/u]')\">\n";
  224. echo "<input type=\"button\" value=\"Link\" onClick=\"javascript:addtext('reactie','[url=] [/url]')\">\n";
  225. echo "<input type=\"button\" value=\"Figuur\" onClick=\"javascript:addtext('reactie','[img] [/img]')\">\n";
  226.  
  227. echo "<br><textarea rows=\"13\" name=\"reactie\" cols=\"41\"></textarea></td>\n";
  228. echo "</tr>\n";
  229. echo "<tr>\n";
  230. echo "<td width=\"50%\">&nbsp;</td>\n";
  231. echo "<td width=\"50%\">\n";
  232.  
  233. // Smilies
  234. echo "<a href=\"javascript:addtext('reactie',':)')\"><img border=\"0\" src=\"images/smilies/icon_razz.gif\" width=\"15\" height=\"15\"></a>\n";
  235. echo "<a href=\"javascript:addtext('reactie',':D')\"><img border=\"0\" src=\"images/smilies/icon_biggrin.gif\" width=\"15\" height=\"15\"></a>\n";
  236. echo "<a href=\"javascript:addtext('reactie',':B')\"><img border=\"0\" src=\"images/smilies/icon_cool.gif\" width=\"15\" height=\"15\"></a>\n";
  237. echo "<a href=\"javascript:addtext('reactie',':S')\"><img border=\"0\" src=\"images/smilies/icon_confused.gif\" width=\"15\" height=\"15\"></a>\n";
  238. echo "<a href=\"javascript:addtext('reactie',':(')\"><img border=\"0\" src=\"images/smilies/icon_cry.gif\" width=\"15\" height=\"15\"></a>\n";
  239. echo "<a href=\"javascript:addtext('reactie',':|')\"><img border=\"0\" src=\"images/smilies/icon_neutral.gif\" width=\"15\" height=\"15\"></a>\n";
  240. echo "<a href=\"javascript:addtext('reactie',':O')\"><img border=\"0\" src=\"images/smilies/icon_eek.gif\" width=\"15\" height=\"15\"></a>\n";
  241.  
  242. echo "<br><input type=\"submit\" value=\"Reageren\" name=\"submit\"></td>\n";
  243. echo "</tr>\n";
  244. echo "<tr>\n";
  245. echo "<td width=\"100%\" colspan=\"2\"><a href=\"?pagina=home\">Ga terug</a></td>\n";
  246. echo "</tr>\n";
  247. echo "</table>\n";
  248. echo "</form>\n";
  249.  
  250. echo "</td>\n";
  251. echo "</tr>\n\n";
  252.  
  253. // Einde Tabel
  254. echo "</table><br>\n";
  255.  
  256. if($copy_on == 1) {
  257. echo $copyright;
  258. } else {
  259. }
  260.  
  261. echo "</center>";
  262.  
  263. }
  264. }
  265.  
  266. ?>

Alvast bedankt,
Yannick

9 antwoorden

Gesponsorde links
Offline Steven - 09/04/2005 20:59
Avatar van Steven HTML interesse Je bedoelt dat je na het plaatsen van een bericht, naar de index gaat of... 
Offline YannickVDS - 09/04/2005 21:01
Avatar van YannickVDS Nieuw lid nee dat ik geen link krijg te zien op mijn index voor te reageren
Offline yannick - 09/04/2005 21:40 (laatste wijziging 09/04/2005 21:40)
Avatar van yannick PHP interesse Ja wat kunnen wij dan met het reactie script doen:?:

Ik heb index.php nodig he ?:p

Greetzzz
Offline YannickVDS - 09/04/2005 21:45
Avatar van YannickVDS Nieuw lid
  1. <?php
  2.  
  3. // *** Bestand: index.php Script: Nieuws *** //
  4.  
  5. // *** Hier onder niet bewerken mits je weet wat je doet. *** //
  6.  
  7. // Database connectie toevoegen
  8. require_once("database.inc.php");
  9.  
  10. // *** NIEUWS INDEX *** //
  11. echo "<title>". $main_title ."</title>";
  12. // Stylesheet
  13.  
  14.  
  15. // Gegevens uit de database ophalen
  16. $select = "SELECT
  17. n.*, COUNT(r.id) AS reacties
  18. FROM
  19. nieuws AS n
  20. LEFT JOIN
  21. reacties AS r ON r.nid = n.id
  22. GROUP BY
  23. n.id
  24. ORDER BY
  25. n.id DESC
  26. LIMIT 0, " . $nieuws_list;
  27.  
  28. $sql = mysql_query($select) or die(mysql_error());
  29.  
  30. // Gegevens laten zien met een while
  31. while($GET = mysql_fetch_assoc($sql))
  32. {
  33.  
  34.  
  35. // Listing in Tabel
  36. echo "<div align='left'>\n";
  37.  
  38. echo "<table class=\"listtable\" cellspacing=\"1\" width=\"75%\">\n";
  39.  
  40. echo "<hr color=\"#657687\" size=\"0\">";
  41. echo "<tr class=\"list0\">\n";
  42. echo "<b>". $GET['titel'] ."</b></td></tr>\n\n";
  43.  
  44. echo "<tr class=\"list1\">\n";
  45. echo "<td class=\"list1\" width=\"100%\"><b>Auteur:</b> <a href=\"http://www.clubactivity.be/?pagina=contactformulier\">". htmlspecialchars($GET['auteur']) ."</a> <b>Geplaatst op</b>: ". htmlspecialchars($GET['datum']) ."<hr color=\"#657687\" size=\"0\">". smilies(nl2br(htmlspecialchars($GET['nieuws']))) ."</td>\n";
  46. echo "<tr class=\"list0\">\n";
  47. echo "</tr>\n\n";
  48.  
  49. echo "</table>\n<br>";
  50.  
  51.  
  52. if($copy_on == 1) {
  53. echo $copyright;
  54. } else {
  55. }
  56.  
  57.  
  58. echo "</div>";
  59.  
  60. }
  61.  
  62. ?>
Offline safpower - 09/04/2005 22:31
Avatar van safpower Lid mijn lodderig ook ziet ook geen link in de code staan naar een andere pagina voor het reageren. 
dan is het vrij logisch. zet gewoon een link
Offline YannickVDS - 09/04/2005 22:54 (laatste wijziging 10/04/2005 01:23)
Avatar van YannickVDS Nieuw lid welke link moet ik daar dan voor gebruiken?

zijn er misschien scripters die mij langs msn actief willen helpen?
Offline DownForZ - 10/04/2005 11:11 (laatste wijziging 10/04/2005 13:33)
Avatar van DownForZ HTML interesse ^^
Offline YannickVDS - 10/04/2005 11:17
Avatar van YannickVDS Nieuw lid Dus waar allemaal $_GET['nid'] in vermeld staat, moet veranderd worden in $_GET['id']
Offline Thomas - 10/04/2005 13:24 (laatste wijziging 10/04/2005 13:24)
Avatar van Thomas Moderator echo echo echo echo echo echo echo echo echo echo echo echo !

Je kan UIT PHP-blokken springen als je (enkel statische) HTML gebruikt hoor...

  1. <?php
  2. if($whatever) {
  3. ?>
  4. <b>Wiehoe!</b> We zitten nu in het if($whatever) statement !<br />
  5. <?php
  6. } // einde $whatever
  7. ?>
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.389s