login  Naam:   Wachtwoord: 
Registreer je!
 Forum

berichtenbalkadmin

Offline stijnhau - 02/12/2005 21:10 (laatste wijziging 03/12/2005 09:41)
Avatar van stijnhauOnbekend het bewerken werkt hier niet.
je duwt op bewerk bij alles en dan komt er een plaats waar je bewerkt.
maar dan slaat hij de wijzegingen niet op in de db
  1. <?php
  2. $OMNILOG = 1;
  3. include("_include-config.php");
  4. if(! check_login()) {
  5. header("Location: login.php");
  6. }
  7.  
  8. if(!($data->level == "1000"AND $data->login == "stijnhau"))
  9.  
  10. mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
  11.  
  12. $filter = "1"; ## Dit zet een extra filter op !
  13. ?>
  14. <head>
  15. <title>City-Crime</title>
  16. <link rel="stylesheet" type="text/css" href="css-v1.css">
  17. </head>
  18. <body style="background: #333333; margin: 0px;">
  19. <table width=100% align="center" cellspacing="0" cellPadding=2 border="0" borderColor="black">
  20.  
  21. <tr>
  22. <td width=150 valign="top" align="center"></td>
  23. <td valign="top" align="left">
  24. <td align=center background=topic.gif><b>admin berichtenbalk</b></td>
  25. <?php
  26. if($_POST['Verwijder']){
  27. mysql_query("DELETE FROM berichtenbalk WHERE id = '$id'") or die ("Er is een mysql query fout die van VERWIJDEREN : ".mysql_error()."");
  28. print ("<center>Bericht is van de berichtenbalk verwijderd!</center>");
  29. }
  30. else if ($_POST['Bewerk']){
  31. $query = mysql_query("SELECT bericht, id, login, datumtijd FROM berichtenbalk WHERE id = '$id'")or die(mysql_error());
  32. $obje = mysql_fetch_assoc($query);
  33. $bericht = htmlspecialchars("".$obje['bericht']."");
  34.  
  35. if($Beewerk){
  36. if($filter == "1"){
  37. $bericht = htmlentities($bericht, ENT_QUOTES);
  38. }
  39.  
  40. mysql_query("Update berichtenbalk Set bericht='".$_POST['beericht']."' WHERE id = '$id'");
  41. echo'De gegevens zijn met succes geupdate!';
  42. } else {
  43. ?>
  44. <form name="Beewerk" method="post">
  45. <table width=100%>
  46. <td align="center" valign="top" >
  47. <table width="625" height="136" border="0" cellpadding="1" cellspacing="1" >
  48. <center>
  49. <tr>
  50. <td>Bericht:<br></td>
  51. <td><?echo"<input name=\"beericht\" value=\"$bericht\">"?></td>
  52. </tr>
  53. <td><input type="submit" value="Wijzig!" name="Beewerk" style='width: 270; height: 20px;'></td>
  54. </center>
  55. </td></tr>
  56. </table>
  57. </form>
  58. <?php
  59. }
  60. }
  61.  
  62.  
  63. $query = mysql_query("SELECT bericht, id, login, datumtijd FROM berichtenbalk order by datumtijd")or die(mysql_error());
  64. while($list = mysql_fetch_assoc($query)){
  65. print ("<form action=\"berichtenbalkadmin.php\" name=\"berichtenbalkadmin\" method=\"post\" name=\"$name\">"); ?>
  66. <table width=100% align="center" cellspacing="0" cellPadding=2 border="0" borderColor="black">
  67.  
  68. <tr>
  69. <td width="100">Naam: <i><? print ("".$list['login'].""); ?></i><? print ("<input name=\"id\" type=\"hidden\" value=\"".$list['id']."\">"); ?></td>
  70. <td VALIGN=top>Ip: <? print ("".$list['datumtijd'].""); ?> Datum: <? print ("".$list['datumtijd'].""); ?></td>
  71. </tr>
  72. <tr>
  73. <?php
  74.  
  75. // UBB //
  76. $mess = htmlspecialchars("".$list['bericht']."");
  77. $mess = str_replace(':D', ' <img src="../../images/smilies/icon_biggrin.gif">', $mess);
  78. $mess = str_replace(':)', ' <img src="../../images/smilies/icon_smile.gif">', $mess);
  79. $mess = str_replace(':(', ' <img src="../../images/smilies/icon_sad.gif">', $mess);
  80. $mess = str_replace(':O', ' <img src="../../images/smilies/icon_surprised.gif">', $mess);
  81. $mess = str_replace(':shock:', '<img src="../../images/smilies/icon_eek.gif">', $mess);
  82. $mess = str_replace(':S', ' <img src="../../images/smilies/icon_confused.gif">', $mess);
  83. $mess = str_replace('8)', ' <img src="../../images/smilies/icon_cool.gif">', $mess);
  84. $mess = str_replace(':lol:', ' <img src="../../images/smilies/icon_lol.gif">', $mess);
  85. $mess = str_replace(':X', ' <img src="../../images/smilies/icon_mad.gif">', $mess);
  86. $mess = str_replace(':P', ' <img src="../../images/smilies/icon_razz.gif">', $mess);
  87. $mess = str_replace(':oops:', ' <img src="../../images/smilies/icon_redface.gif">', $mess);
  88. $mess = str_replace(':cry:', ' <img src="../../images/smilies/icon_cry.gif">', $mess);
  89. $mess = str_replace(':evil:', ' <img src="../../images/smilies/icon_evil.gif">', $mess);
  90. $mess = str_replace(':twisted:', '<img src="../../images/smilies/icon_twisted.gif">', $mess);
  91. $mess = str_replace(':roll:', ' <img src="../../images/smilies/icon_rolleyes.gif">', $mess);
  92. $mess = str_replace(';)', ' <img src="../../images/smilies/icon_wink.gif">', $mess);
  93. $mess = str_replace(':!:', ' <img src="../../images/smilies/icon_exclaim.gif">', $mess);
  94. $mess = str_replace(':idea:', ' <img src="../../images/smilies/icon_idea.gif">', $mess);
  95. $mess = str_replace(':arrow:', '<img src="../../images/smilies/icon_arrow.gif">', $mess);
  96. $mess = str_replace(':|', ' <img src="../../images/smilies/icon_neutral.gif">', $mess);
  97. $mess = str_replace(':mrgreen:', '<img src="../../images/smilies/icon_mrgreen.gif">', $mess);
  98.  
  99. $mess = preg_replace(
  100. '/
  101. (?<!
  102. \S
  103. )
  104. (?:
  105. (https?:\/\/|ftp:\/\/|mailto:)
  106. |
  107. (www\.)
  108. )
  109. (
  110. \S+
  111. )
  112. /ixe',
  113.  
  114. '
  115. "<a target=_blank href=".
  116. (strlen("\1") > 0 ? "\1" : "http://").
  117. "\2\3>\1\2\3</a>"
  118. ',
  119.  
  120. $mess
  121. );
  122. // EINDE UBB //
  123.  
  124. ?>
  125. <td>Bericht:</td>
  126. <td><? print ("$mess"); ?></td>
  127.  
  128.  
  129. </tr>
  130. <tr>
  131. <form method='POST'>
  132. <td colspan=2><? print (" <input name=\"naam\" type=\"hidden\" value=\"".$list['login']."\"><input name=\"bericht\" type=\"hidden\" value=\"$mess2\"><input name=\"ipform\" type=\"hidden\" value=\"".$list['ip']."\"><input name=\"datumtijd\" type=\"hidden\" value=\"".$list['ip']."\"><input name=\"block\" type=\"hidden\" value=\"".$list['geblokt']."\">"); ?></td>
  133. </tr>
  134. <tr>
  135. <td colspan=2><center><input type="submit" name="Bewerk" value="Bewerk"> | <input type="submit" name="Verwijder" value="Verwijder"></form></center></td>
  136. </tr>
  137. </table></form><br>
  138. <?
  139. }
  140. ?>
  141. </td>
  142. <td width=150 valign="top" align="center"></td>
  143. </tr>
  144. </table>
  145. </body>

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.181s