PHP? ??? ?? ??? ??? ?? ??? ?????(4)
??? ?? ??? ?? <??> ??? ??? ? ?? ??? ??? ???? ????.
?? ?? "? ?? ??"? ???? ?? ??? ??? ?? ?? ???? ?????. ,
??????? ??? ???? ???????.
<input name="newitem" type="text" id="newitem" /> <input type="submit" name="Submit2" value="添加新項(xiàng)" />
?????? SQL ?? INSERT INTO? ???? ?????? ???? ? ??? ?????.
<?php if(isset($_POST["Submit2"])) { $newitem=$_POST["newitem"]; $SQL="INSERT INTO vote (titleid,item,count) VALUES (1,'$newitem',1)"; mysqli_query($link,$sql); } ?>
"? ?? ??" ??? "??? ??"? ???? ?? ??? index.php? ?????.php
?? ??? ?? ??? ????, ?? ???? ???? ?? ??? ???? ??? ???? ???.
HTML ??:
<a href="?tj=out">退出管理</a>
PHP ??:
<?php if(isset($_GET['tj']) == 'out'){ session_destroy();//刪除當(dāng)前用戶對(duì)應(yīng)的session文件以及釋放session echo "<script language=javascript>alert('退出成功!');window.location='index.php'</script>"; } ?>