我内部有一个 client(utc+8) jdbc of pg dbserver(utc)
upload time 1443145546920 + tzoffset
- tzoffset 480m
write 1443145546920
download
send 1443145546920
+ tzoffset 480m
got 1443145546920 + tzoffset
manual substract tzoffset
和一个$item = $_GET['item'];
$item = str_replace("\"", "", $item);
$item = str_replace("\'", "", $item);
$item = str_replace(" ", "%20", $item);
$item = str_replace("\\", "", $item);
$item = str_replace("(", "%28", $item);
$item = str_replace(")", "%29", $item);
。我想添加reCaptcha,但表单检查没有收到reCaptcha的form
值。这是我的表格:
table
$_POST
问题是,在<form name="reg" action="code_exec.php" onsubmit="return validateForm()" method="post">
<td colspan="2">
<div align="center">
<h1>Register</h1>
</div></td>
</tr>
<tr>
<td colspan="2"><center><p style="font-family: Arial; font-size: 18px; color: red;">*<span style="color: red; font-family: Arial; font-size: 14px;">Required</span></p></center></td>
</tr>
<tr>
<td><div align="right">Name:<span class="red">*</span></div></td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td><div align="right">Username:<span class="red">*</span></div></td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td><div align="right">E-mail:<span class="red">*</span></div></td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td><div align="right">Password:<span class="red">*</span></div></td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td><div align="right">Confirm Password:<span class="red">*</span></div></td>
<td><input type="password" name="passwordconf" /></td>
</tr>
<tr>
<td></td>
<td><div class="g-recaptcha" data-sitekey="6LfDzgITAAAAABkYv1oZe4X7Sy3OqYmk4hQQBMHz"></div></td>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input name="submit" type="submit" value="Submit" /></td>
</tr>
<tr>
<td></td>
<td><br><a href="../login">Log In</a>
</tr>
<tr>
<td><div align="right"></div></td>
<td><input type="text" name="captchaid" style="visibility: hidden;" value="<?php echo $captchaid?>" /></td>
</tr>
</table>
</table>
</form>
之后,$captcha=$_POST['g-recaptcha-response'];
var_dump($_POST);
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6LfDzgITAAAAAD-l4TY_v6Tnqtb8Y0mtEB-HjApC&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']);
if($response.success==false) {
//do stuff
}
else {
//process form
}
没有出现。任何解决方案?