Advertisement
Evolutio

Untitled

Apr 25th, 2011
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.93 KB | None | 0 0
  1. <?php
  2. if(!$r_news) { die("<meta http-equiv='refresh' content='0;URL=../../403.php'>"); }
  3. ?>
  4. <form action="" method="post" onfocus="this.blur()">
  5. <?php
  6. $timestamp = time();
  7. $datum = date("d.m.Y", $timestamp);
  8. $zeit = date("H:i", $timestamp);
  9. $datumundzeit = $datum." ".$zeit;
  10. mysql_query("SET NAMES 'utf8'");
  11. mysql_query("SET CHARACTER SET utf8");
  12. $news = MYSQL_QUERY("SELECT * FROM YGR_Webnews");
  13. $news_count = MYSQL_NUM_ROWS($news);
  14. $news_count++;
  15. ?>
  16. <br>
  17. <center>
  18. <font style="font-size: 20px;"><b>&raquo; Eintragung &laquo;</b></font><br><br>
  19. <img src="../../images/radio/websitenews.png" border="0" height="64" width="64" alt="Eintragung" title="Eintragung"><br><br><br>
  20. <table width="315px" border="0">
  21. <tr align="center">
  22. <td>ID:
  23. <font style="font-size: 3px;"><br><br></font>
  24. <input style="width: 300px; border-color: #414141; color: #ADC8E3; background: #414141" type="Text" name="id" value="<?php echo $news_count; ?>" readonly size="2">
  25. <font style="font-size: 15px;"><br><br></font>
  26. Author:
  27. <font style="font-size: 3px;"><br><br></font>
  28. <input style="width: 300px; border-color: #414141; color: #ADC8E3; background: #414141" maxlength="10" type="Text" name="author" size="40" value="<?php echo $_COOKIE['login_user'] ?>" readonly>
  29. <font style="font-size: 15px;"><br><br></font>
  30. Datum:
  31. <font style="font-size: 3px;"><br><br></font>
  32. <input style="width: 300px; border-color: #414141; color: #ADC8E3; background: #414141" maxlength="16" type="Text" name="datum" value="<?php echo $datumundzeit ?>" readonly size="40">
  33. <font style="font-size: 15px;"><br><br></font>
  34. Headline:
  35. <font style="font-size: 3px;"><br><br></font>
  36. <input style="width: 300px; border-color: #414141; color: #ADC8E3; background: #414141" maxlength="50" type="Text" name="headline" size="40">
  37. <font style="font-size: 15px;"><br><br></font>
  38. Nachricht:
  39. <font style="font-size: 3px;"><br><br></font>
  40. <textarea style="width: 300px; height: 150px; border-color: #414141; color: #ADC8E3; background: #414141" name="news" cols="30" rows="5"></textarea>
  41. <font style="font-size: 7px;"><br><br></font>
  42. <input type="Submit" style="width: 85px;" value="Bestätigen" name="speichern" onfocus="this.blur()"></td>
  43. </tr>
  44. </table>
  45. <?
  46. if(isset($_POST['speichern'])){
  47. $author = $_POST['author'];
  48. $zeit = $_POST['datum'];
  49. $headline = $_POST['headline'];
  50. $news = $_POST['news'];
  51.  
  52. if(strlen($news)>280)
  53.     die("<center><br>*Bitte beachte die Nachrichtenlänge!<br>(max. 280 Zeichen)</center>");
  54.  
  55.  
  56. $eintragen = "INSERT INTO YGR_Webnews (Author, Zeit, Headline, Text) VALUES ('".mysql_real_escape_string($author)."','".mysql_real_escape_string($zeit)."','".mysql_real_escape_string($headline)."','".mysql_real_escape_string($news)."')";
  57. mysql_query("SET CHARACTER SET utf8");
  58. $eintrag = MYSQL_QUERY($eintragen);
  59. if($eintrag) echo "<meta http-equiv='refresh' content='0;URL=user.php?site=websitenews'>";
  60. else echo "Fehler beim Speichern<br><br>".MYSQL_ERROR(); }
  61. ?></center>
  62. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement