後台使用php,前台引用jquery,實現增刪操作,代碼如下:
<script type="text/javascript" src="http://keleyi.com/keleyi/pmedia/jquery/jquery-1.10.2.min.js"></script> <? ("Content-type: text/html; charset=utf-8" ("set charaset set utf-8" =@["message" =@["shanchu" ="PHP基礎練習" =("localhost","root","" mysql_set_charset('utf-8', ("dbl", ="select `message` ,`time`,`id` from message order by id desc limit 0,30" =(, =('Y-m-d h:i:s', =(); ((["submits" (!["message"]== =("insert into message (message,time) values('%s','%s')", ['message'], (, (["message"]== "" ("Location:http://localhost/table.php" ((["ClearTd"]) && (['ClearTd' ="delete from message where id=".['ClearTd' (, ("Location:http://localhost/table.php" ?> <form method="post" action="table.php"> <textarea name="message" id="message"></textarea> <input type="submit" name="submits"> </form> <ul> <?php (=(, ?> <li> <?php ( }?> <a name="ClearTd" href="?ClearTd=<?php echo ['id'];?>">刪除</a> </li> <?php } ?> </ul>