טעוותתת הנה הדף
PHP קוד:
<?php
if (!isset($_POST['submit'])) // אם לא נשלח הטופס אז..
{
header("location: form.htm");
}
else
{
// הצבת משתנים
$subject = $_POST['subject'];
$content = $_POST['content'];
//התחברות לבסיס נתונים
mysql_connect('localhost','logicserv_news','salio') or die("ERROR: ".mysql_error());
mysql_select_db('logicserv_news') or die("ERROR: ".mysql_error()); // החלף את שם בסיס הנתונים בשם שקבעת
//הכנסת נתונים
mysql_query("INSERT INTO 'news'('subject','content') VALUES('$subject','$content')") or die("ERROR: ".mysql_error());
echo("הכתבה נוספה בהצלחה לבסיס הנתונים");
}
?>