php和js交互一例-PHP教程,PHP应用

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

<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]); 
//$guest_name=str2js($myrow[guest_name],"'"); 
$dele_mess="真的要删除这个留言吗?\n留言姓名:$guest_name($myrow[guest_ip])"."\n留言时间:$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>

相关文章

PHP实现的XXTEA加密解密算法示例

本文实例讲述了PHP实现的XXTEA加密解密算法。分享给大家供大家参考,具体如下: <?php /** * Xxtea 加密实现类 */ class xxtea {...

关于shopex同步ucenter的redirect问题,导致script不运行

首先此问题来自向这个帖子 http://hi.baidu.com/fire_love_live/item/247276cfda421217b67a24c7 需要说明的是,并非15处需要修...

php查看网页源代码的方法

本文实例讲述了php查看网页源代码的方法。分享给大家供大家参考。具体实现方法如下: <?php $url = "//www.jb51.net"; $fp = @fope...

PHP的反射机制实例详解

本文实例讲述了PHP的反射机制。分享给大家供大家参考,具体如下: 介绍: PHP5添加了一项新的功能:Reflection。这个功能使得phper可以reverse-engineer c...

PHP实现过滤各种HTML标签

首先分享一些比较常见的 $str=preg_replace("/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]*...