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

yipeiwu_com5年前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数组一对一替换实现代码

复制代码 代码如下: <?php header("Content-type: text/html; charset=utf-8"); function multiple_repla...

PHP执行速率优化技巧小结

1.在可以用file_get_contents替代file、fopen、feof、fgets等系列方法的情况下,尽量用file_get_contents,因为他的效率高得多!但是要注意f...

使用php实现快钱支付功能(涉及到接口)

本项目用zend framework框架实现的modules/default/controllers/IndexController.phpIndexController.php复制代码...

详解PHP中的mb_detect_encoding函数使用方法

php中可以使用 mb_detect_encoding() 函数来判断字符串是什么编码的。 当在php中使用mb_detect_encoding函数进行编码识别时,很多人都碰到过识别编码...

php计算整个目录大小的方法

本文实例讲述了php计算整个目录大小的方法。分享给大家供大家参考。具体实现方法如下: /** * Calculate the full size of a directory *...