宏朋雄  2012-06-11 22:41
2012-06-12 01:49
 
最佳答案
 
<img src=“验证码文件路径"  onclick = "this.src='验证码路径?'+Math.random()"/>
其他同理!
 

PHP学习笔记(6)js点击刷新验证码

jiangxibaiyi 

采纳率:55% 来自团队:IT精英俱乐部 擅长: 其他社会话题 夫妻 博彩

PHP学习笔记(6)js点击刷新验证码

 

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
</head>
<body>
    <form action="" method = "get">
        用户名
        <input type="text">
        密码
        <input type="text">
        <img src="yanzhengma.php" id = "yanzhengma"></form>
    <img src="yanzhengma.php">
    <?php 
    $var = '<script type="text/javascript">
    onload = function(){
        var yanzhengma = document.getElementById("yanzhengma");
        yanzhengma.onclick = function(){
            this.src = "yanzhengma.php?"+Math.random();
        };
    }
    
</script>';
    echo $var ?>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-11-16
  • 2022-02-28
猜你喜欢
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2022-02-16
  • 2021-10-11
  • 2021-11-10
  • 2022-12-23
相关资源
相似解决方案