Php 雷帕查破坏了我的代码
几周来我一直收到垃圾邮件。我能够在我的一些页面上用表单获取一些recaptcha,但也有一些不起作用。我的一些网站是用CMS做的,其他部分是从头开始做的。所以有一个名为sign-up.php的页面。这是一个表单点击率最高的页面。形式结构有点奇怪。我添加的唯一内容是php标记和标记内部的recaptcha脚本。我已经找到了这个表单发布到的文件,但是当我添加google recaptcha告诉我添加的任何内容时,它崩溃了。我尝试过添加一些简单的行,比如include_once(recaptchalib.php),但它仍然崩溃Php 雷帕查破坏了我的代码,php,recaptcha,Php,Recaptcha,几周来我一直收到垃圾邮件。我能够在我的一些页面上用表单获取一些recaptcha,但也有一些不起作用。我的一些网站是用CMS做的,其他部分是从头开始做的。所以有一个名为sign-up.php的页面。这是一个表单点击率最高的页面。形式结构有点奇怪。我添加的唯一内容是php标记和标记内部的recaptcha脚本。我已经找到了这个表单发布到的文件,但是当我添加google recaptcha告诉我添加的任何内容时,它崩溃了。我尝试过添加一些简单的行,比如include_once(recaptchali
<div class="big_box">
<form name="signup" method="post" action="">
<div class="container_shadowl"></div>
<div class="container">
<div class="h1_title">Sign Up</div>
<p class="cntp cntmleft">
....
<div class="cntcontact">
<div class="cntbox1a" style="width:285px;padding-top:35px; padding-left:120px !important">
<input type="hidden" name="submit" value="submitted" />
<table border="0" cellpadding="0" cellspacing="0" class="input-td">
<tr>
<td style="width:110px;" class="ctninput">* First Name</td>
<td><input name="first_name" type="text" class="cntinputfield" value="<?=$values['first_name']?>" <?=$field['first_name']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* Last Name</td>
<td><input name="last_name" type="text" class="cntinputfield" value="<?=$values['last_name']?>" <?=$field['last_name']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* Company</td>
<td><input name="company" type="text" class="cntinputfield" value="<?=$values['company']?>" <?=$field['company']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* Phone</td>
<td><input name="phone" type="text" class="cntinputfield" value="<?=$values['phone']?>" <?=$field['phone']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* E-Mail (Username - Case Sensitive)</td>
<td><input name="email" type="text" class="cntinputfield" value="<?=$values['email']?>" <?=$field['email']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* Password (Case Sensitive)</td>
<td><input name="password1" type="password" class="cntinputfield" id="password1" value="<?=$values['password1']?>" <?=$field['password1']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>* Confirm</td>
<td><input name="password2" type="password" class="cntinputfield" value="<?=$values['password2']?>" <?=$field['password2']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>Address</td>
<td><input name="address" type="text" class="cntinputfield" value="<?=$values['address']?>" <?=$field['address']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>City</td>
<td><input name="city" type="text" class="cntinputfield" value="<?=$values['city']?>" <?=$field['city']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>State</td>
<td><select name="state" class="text2" id="state" class="cntinputfield" style="border:1px solid #ccc;">
<?
for($i=1;$i<TAMSTATES;$i++){
?>
<option value="<?=$CMBstateS[$i]?>" <? if(STATEDEFAULTS==$i){?> selected="selected"<? }?>>
<?=$CMBstateS[$i]?>
</option>
<? }?>
</select>
</td>
</tr>
<tr>
<td>Zip</td>
<td><input name="zip" type="text" class="cntinputfield" value="<?=$values['zip']?>" <?=$field['zip']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>How Did You Hear About Us?</td>
<td><input name="hear" type="text" class="cntinputfield" value="<?=$values['hear']?>" <?=$field['hear']?> style="border:1px solid #ccc;"/></td>
</tr>
<tr>
<td>Rep ID or Promo Code</td>
<td><input name="promo" type="text" class="cntinputfield" value="<?=$values['promo']?>" <?=$field['promo']?> style="border:1px solid #ccc;"/></td>
</tr>
</table>
<p class="cntsmall" style="display:inline">*required fields</p>
<div class="clear"></div>
</div>
<div class="cntbox2" style="width:400px;padding-left:0px !important">
<!-- <div class="cntcol1" style="width:275px;">
</div>-->
<div class="cntcol2" style="width:100%; padding-left:15px;">
<p><span style="font-size:12px;">Message</span>
<br />
<textarea name="message" cols="50" rows="10" class="cntinputfield cnttextarea" style="margin-top:5px;width:300px;height:75px !important; border:1px solid #ccc;" ><?=$values['message']?>
</textarea>
<br />
<br />
<span style="font-size:12px;font-weight:bolder;">Terms and Conditions</span>
<textarea readonly="readonly" name="terms" cols="50" rows="10" class="cntinputfield cnttextarea" style="margin-top:5px; width:300px; height:115px !important; border:1px solid #ccc;" ><?=$terms_conds?>
</textarea>
<br />
<input type="checkbox" name="terms_agree" value="1" />
<small>I agree to the Terms and Conditions</small>.
</p>
<?php
require_once('recaptchalib.php');
$publickey = "6LelV8ESAAAAAEo6PETdSv0KvHwbIlM8394qUz0o";
echo recaptcha_get_html($publickey);
?>
<div class="clear"></div>
<input type="image" style="display:inline; padding-top:10px;" xonclick="document.signup.submit();" src="img/btn_cnt_send.jpg" alt="SUBMIT" />
</div>
<div class="clear"></div>
注册
....
*名字
style=“border:1px solid#ccc;”/>
*姓
style=“border:1px solid#ccc;”/>
*公司
style=“border:1px solid#ccc;”/>
*电话
style=“border:1px solid#ccc;”/>
*电子邮件(用户名-区分大小写)
style=“border:1px solid#ccc;”/>
*密码(区分大小写)
style=“border:1px solid#ccc;”/>
*证实
style=“border:1px solid#ccc;”/>
地址
style=“border:1px solid#ccc;”/>
城市
style=“border:1px solid#ccc;”/>
陈述
style=“border:1px solid#ccc;”/>
你是怎么听说我们的?
style=“border:1px solid#ccc;”/>
代表ID或促销代码
style=“border:1px solid#ccc;”/>
*必填字段
信息
条款和条件
我同意这些条款和条件。
我建议看一看,因为与recaptcha相比,它非常容易使用(心目中的PHP)
该代码示例已损坏:)。查询字符串中缺少?
。下面是一个正确的例子:
<?php
session_start();
if(isset($_POST['captcha'])) {
$captcha = $_POST['captcha'];
$uid = $_SESSION['uid'];
echo file_get_contents("http://www.easycaptchas.com/check.aspx?sessionid=$uid&input=$captcha");
exit();
}
$uid = $_SESSION['uid'] = uniqid();
?>
<form method="post">
<input name="captcha" size="16"/>
<img id="captchaimg" src="http://www.EasyCaptchas.com/<?= $uid; ?>.captcha?" />
<a href="http://www.easycaptchas.com/" onclick="document.getElementById('captchaimg').src+='rf=1';return false;" style="font-size:9px">refresh</a><br />
<!-- Free Captcha provided courtesy of www.EasyCaptchas.com (please do not remove this link) -->
<noscript><a href="http://www.easycaptchas.com/" onclick="return false;" style="display:none">Captcha</a></noscript>
</form>
<script>
console.log(document.getElementById('captchaimg').src);
</script>
.验证码?/>
log(document.getElementById('captchaimg').src);
是的,谢谢。EasyCaptchas安装非常简单。唯一不起作用的是刷新链接。我的代码与他们网站上的测试代码一模一样。有什么想法吗?“onclick=“document.getElementById('captchaimg').src+='&rf=1';return false;”style=“font size:9px”>刷新我所能想到的,若你们并没有复制图像的id。您的图像还必须具有正确的id=>@giant man更新了我的代码。由于缺少querystring,该站点的示例被破坏。