i am using this script as a form to enter articles into databas,
the variable post_content comes from wysiwyg script
but when i execute the script everything goes fine except it doesn't insert any rown in the databse
can anyone tell me what is wrong with my code ?
<?php ob_start();
$post_title = addslashes($post_title);
$post_author = addslashes($post_author);
$post_content = addslashes($post_content);
$post_date = addslashes($post_date);
$db = mysql_connect("localhost", "root"); mysql_select_db("balady", $db); $query = "insert into 'posts' ( `post_id` , `post_title` , `post_date` , `post_author` , `post_content` , `m_cat_id` , `s_cat_id` , `post_pic`) values (\'\', \'$post_title, \'$post_title, \'$post_author, \'$post_content, \'\', \'\', \'subject.gif\' )"; mysql_query($query);
?>
<html> <head> <title>Add Article</title> </head> <body>
<form name="post_article" method="post" action="" > <table border="0" width="56%" id="table1"> <tr> <td width="193"><b><span lang="ar-eg"> <font size="3" face="Simplified Arabic">عنوان الموضوع</font></span></b></td> <td width="341"><input type="text" name="post_title" size="40" dir="rtl"></td> <td> </td> </tr> <tr> <td width="193"><b><span lang="ar-eg"> <font size="3" face="Simplified Arabic">اسم الكاتب</font></span></b></td> <td width="341"><input type="text" name="post_author" size="40" dir="rtl"></td> <td> </td> </tr> <tr> <td width="193"><b><font size="3" face="Simplified Arabic"> <span lang="ar-eg">تاريخ الموضوع</span></font></b></td> <td width="341"><input type="text" name="post_date" size="40" dir="rtl"></td> <td> </td> </tr> <tr> <td> </td> <td> <?php
// include the config file and editor class:
include_once ('editor_files/config.php'); include_once ('editor_files/editor_class.php');
// create a new instance of the wysiwygPro class:
$editor = new wysiwygPro(); $editor->set_name('post_content');
// print the editor to the browser:
$editor->print_editor(700, 400);
?> </td> </tr> <tr> <td width="193"> </td> <td width="341"><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="reset"></td> <td> </td> </tr>
</TABLE> </form> </body> </html>
<?php ob_end_flush(); ?>
|