Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submit'])) {
- $title = $_POST['title'];
- $content = $_POST['content'];
- $author = $_POST['author'];
- $date = date("Y-m-d");
- mysql_query("INSERT INTO `DreamCMS_News` (title, content, author, date)
- VALUES ('$title', '$content', '$author', '$date')") OR DIE(mysql_error());
- echo "<h1>Article successfully added.</h1>";
- }
- echo "
- <form action='' method='post'>
- Title: <input name=title type=text><br/>
- <textarea name=content rows=5 cols=50>News Article Here</textarea><br/>
- Author: <input name=author type=text><br/>
- <input type=submit name=submit value='Post'>
- ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement