PHP ?? ?? ?? ??? ?? ?????? ?? ??? ??
? ?? ?? ???
?? ?? ???? ??? ????.
??? ??? ????.
<?php require_once("../connect.php"); //把傳遞過來的信息入庫(kù),在入庫(kù)之前對(duì)所有的信息進(jìn)行校驗(yàn)。 if(!(isset($_POST['title'])&&(!empty($_POST['title'])))){ echo "<script>alert('標(biāo)題不能為空');history.go(-1);</script>"; } $title = $_POST['title']; $author = $_POST['author']; $description = $_POST['description']; $content = $_POST['content']; $dateline = time(); $insertsql = "insert into article(title, author, description, content, dateline) values('$title', '$author', '$description', '$content', $dateline)"; //echo $insertsql; //exit; if(mysqli_query($conn,$insertsql)){ echo "<script>alert('發(fā)布文章成功');window.location.href='admin_manage.php';</script>"; }else{ echo "<script>alert('發(fā)布失敗');history.go(-1);</script>"; } ?>
?? ??
?? ??? ??? ??????? ???? ??????? ????
??? ?? ??? ?? ?????? ?????. ??? ?? ?? ??? ??? ? ??? ???? ?????. ?? ???? ?? ????
post ???? ?? ??? ?? ?? ???? ??? ?????
? ?????. ??? ???? ??????? ???? ?? ??? ?????. ???? ??? ??? ????? ???? ????, ???? ???? ???? ?? ?? ???? ?????