Talon21 Posted June 13, 2008 Share Posted June 13, 2008 Hi All, I want to build my own CMS , first I built a Html form : <form method="post"> <table width="700" border="0" cellpadding="2" cellspacing="1" align="center"> <tr> <td width="100">Title</td> <td><input name="title" type="text"></td> </tr> <tr> <td width="100">Content</td> <td><textarea name="content" cols="50" rows="10"></textarea></td> </tr> <tr> <td width="100"> </td> <td> </td> </tr> <tr> <td colspan="2" align="center"><input name="save" type="submit" value="Save Article"></td> </tr> </table> </form> In first stage the form will have two fields Title and Content. Then I created a Script that supposed to add the page information to the database: <?php if(isset($_POST['save'])) { $title = $_POST['title']; $content = $_POST['content']; if(!get_magic_quotes_gpc()) { $title = addslashes($title); $content = addslashes($content); } include 'library/config.php'; include 'library/opendb.php'; $query = " INSERT INTO news (title, content) ". " VALUES ('$title', '$content')"; mysql_query($query) or die('Error'); include 'library/closedb.php'; echo "Article '$title' added"; } ?> But I'm keep on getting the Error message. Quote Link to comment Share on other sites More sharing options...
Vizor Posted June 13, 2008 Share Posted June 13, 2008 Post the error message... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.