1 <p class="pass-form-item"> 2 <label class="pass-label">验证码</label> 3 <input type="text" name="verifyCode" class="pass-text-input " placeholder="请输入验证码" > 4 <div> 5 <img src="{:captcha_src()}" alt="captcha" id="captcha_img" onclick="this.src='http://<?php echo $_SERVER['HTTP_HOST']; ?>/tp/public/index.php/captcha?_='+ new Date().getTime();"> 6 <span onclick="captcha_img.src='http://<?php echo $_SERVER['HTTP_HOST']; ?>/tp/public/index.php/captcha?_='+ new Date().getTime();"><a href="###">看不清,换一张</a></span> 7 </div> 8 </p>
$_SERVER['HTTP_HOST'] ----- 获取当前页面域名;