Home > php教程 > php手册 > body text

php验证码刷新与局部刷新

WBOY
Release: 2016-06-06 19:46:44
Original
1281 people have browsed it

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 实现php 验证码调用时的刷新与局部刷新,这二种情况在网站开发中均有使用。 一、验证码刷新 代码示例: form method="post" name="login" action="" 验 证 码:input type="text" name="code" class=

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

  实现php 验证码调用时的刷新与局部刷新,这二种情况在网站开发中均有使用。

  一、验证码刷新

  代码示例:

  

  验 证 码: php验证码刷新与局部刷新

  

  方法1、借助js伪类

  代码示例:

  php验证码刷新与局部刷新

  方法2、引入外部文件

  在

之间引入外部文件

  代码示例:

  

  //外部文件code.js设置局部刷新函数

  //link http://

  function code () {

  var code = document.getElementByIdx_x_x('code');

  code.onclick = function () {

  this.src='code.php?tm='+Math.random();

  };

  };

  二、在验证码旁边加上说明文字,点击文字时才刷新

  代码示例:

  

  验 证 码: php验证码刷新与局部刷新

  点击刷新验证码

  

  方法1、借助js伪类

  代码示例:

  php验证码刷新与局部刷新

  方法2、引入外部文件

  在

之间引入外部文件

  代码示例:

  

  //外部文件code.js设置局部刷新函数

  function code () {

  var code = document.getElementByIdx_x_x('code');

  var update = document.getElementByIdx_x_x('update');

  update.onclick = function () {

  code.src='code.php?tm='+Math.random();

  };

  };

php验证码刷新与局部刷新

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!