<?php
include ("conn.php");
$id=$_POST['id'];
$user=$_POST['user'];
$title=$_POST['title'];
$content=$_POST['content'];
if($_POST['submit']){
$sql="insert into message(id,user,title,content,lastdate)VALUES('','$user','$title','$content',now())";
mysql_query($sql);
echo "<seript>alert('提交成功');location.href='add.html';</seript>";
}
?>
I'm not curious about anything else, I'm just curious about where your $id came from. Is there an id in the submitted $_POST array? It seems that I didn’t see
when I output it.It's not<seript>, it's<script>
echo "<seript>alert('Submission successful');location.href='add.html';</seript>"; Take a closer look at this statement to find any errors?