php和js交互一例
来源:程序员人生 发布时间:2013-11-03 17:43:31 阅读次数:2804次
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <title>Untitled</title>
- <script language="JavaScript">
- <!--
- function rec_delete(message){
- return confirm(message);
- }
-
- </script>
- </head>
- <body>
- <?php
- $myrow[guest_name]="asdf"";
- $myrow[guest_name]="asdf'";
- $guest_name=addslashes($myrow[guest_name]);
-
- $dele_mess="真的要删除这个留言吗? 留言姓名:$guest_name($myrow[guest_ip])"." 留言时间:$myrow[guest_time]";
- echo "<script>";
- echo "delete_mess="$dele_mess"";
- echo "</script>";
- ?>
- <a href="<?php echo "$PHP_SELF?opt=delete"; ?>" onClick='return rec_delete(delete_mess)'>删除</a>
- </body>
- </html>
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠