Advertisement
AndreiMikalov

Untitled

Oct 2nd, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['submit'])) {
  4.  
  5. $title = $_POST['title'];
  6. $content = $_POST['content'];
  7. $author = $_POST['author'];
  8. $date = date("Y-m-d");
  9.  
  10. mysql_query("INSERT INTO `DreamCMS_News` (title, content, author, date)
  11. VALUES ('$title', '$content', '$author', '$date')") OR DIE(mysql_error());
  12.  
  13. echo "<h1>Article successfully added.</h1>";
  14.  
  15. }
  16.  
  17. echo "
  18. <form action='' method='post'>
  19. Title: <input name=title type=text><br/>
  20. <textarea name=content rows=5 cols=50>News Article Here</textarea><br/>
  21. Author: <input name=author type=text><br/>
  22. <input type=submit name=submit value='Post'>
  23.  
  24. ";
  25.  
  26. ?>
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement