This is the code for the message section of the page. The problem is that the account is logged in, and then the message title and content are written, but the display fails after submission. I don’t know what went wrong. I hope you can teach me. Thank you. !
<?php require("header.php"); if($_SESSION[username]=="") { echo "<script>alert('请先登录');history.back();</script>"; exit; } if($act=="save") { if($title=="" || $content=="") { echo "<script>alert('留言标题,内容,不能为空');history.back();</script>"; exit; } $sql="insert into liuyan (title,content,userid) values ('$title','$content','$_SESSION[username]')"; $res=mysql_query($sql); if($res) { echo "<script>alert('成功');location.href='guest.php';</script>"; exit; } else exit("失败了"); } ?>
The above is the content of the message data table