PHP קוד:
<html dir="rtl">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<meta http-equiv="Content-Language" content="he">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>שלח מאמר</title>
<?php
$title = $_POST["title"];
$poster = $_POST["poster"];
$text = $_POST["text"];
$date = date("d/m/Y - H:i:s");
if ($_POST["posted"] == 1) {
if(!$title) {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לכתוב כותרת!\"); history.go (-1);</script>");
}
if(!$poster) {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לציין את שם הכותב!\"); history.go (-1);</script>");
}
if(!$text) {
die("<script type=\"text/javascript\">window.alert(\"שגיאה: חובה לציין תוכן!\"); history.go (-1);</script>");
}
include "config.php";
mysql_query("INSERT INTO `topics` VALUES ('','$title','$poster','$text','$image','$date')") or die("שגיאה");
?>
המאמר נשלח בהצלחה
<?php
}
?>
<body style="font-family: Arial">
<form action="post.php" method="post">
<input type="hidden" name="posted" value="1">
כותרת: <input type="text" name="title" size="20"><Br />
שמך: <input type="text" name="poster" size="20"><Br />
תמונה: <input type="text" name="image" size="20"> <b><font size="2">(<a href="#" onClick="window.open('upload/upload.html','העלאת קבצים','scrollbars=no,location=no,status=no,height=130,width=400');" style="text-decoration: none">העלה</a>)</font></b><Br />
תוכן: <br />
<textarea cols=50 rows=10 name="text"></textarea><br />
<input type="submit" name="submit" value="פרסם מאמר">
</form>
</html>
הבעיה לא בקובץ שליחה תבין.