Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['sended']))
- {
- $hl = mysql_real_escape_string($_POST['headl']);
- $text = mysql_real_escape_string(nl2br($_POST['article']));
- $from = $_POST['author'];
- $date = date("F j, Y, g:ia");
- if(!$hl || !$text || !$from || !$date)
- {
- echo "<div class=\"alert alert-danger\"><strong>Fehler</strong>: Du musst alle Felder ausfüllen.</div>";
- }
- else
- {
- $query = mysql_query("INSERT INTO news (id, headline, text, author, createdate, comments) VALUES ('','$hl','$text','$from','$date','0')") or die;
- echo "<div class=\"alert alert-success\"><strong>Erfolgreich</strong>: Artikel erstellt.</div>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement