Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['sended']))
  3. {
  4. $hl = mysql_real_escape_string($_POST['headl']);
  5. $text = mysql_real_escape_string(nl2br($_POST['article']));
  6. $from = $_POST['author'];
  7. $date = date("F j, Y, g:ia");
  8.  
  9. if(!$hl || !$text || !$from || !$date)
  10. {
  11. echo "<div class=\"alert alert-danger\"><strong>Fehler</strong>: Du musst alle Felder ausfüllen.</div>";
  12. }
  13. else
  14. {
  15. $query = mysql_query("INSERT INTO news (id, headline, text, author, createdate, comments) VALUES ('','$hl','$text','$from','$date','0')") or die;
  16. echo "<div class=\"alert alert-success\"><strong>Erfolgreich</strong>: Artikel erstellt.</div>";
  17. }
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement