- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
无论我输入什么(即使是正确的验证码),我总是得到不匹配的输出。我试过回应这些值(如果您输入正确的代码,它们应该匹配)。我总是得到这样的东西:
6952304285049
-1247767175
这是我的代码(我也在做一些其他验证):
<?php
include 'Header.php';
include 'Database.php';
?>
<script type="text/javascript">
$(function() {
$('#defaultReal').realperson();
});
</script>
<h1>Sign Up</h1>
<?php
if ($_POST){
$username = $_POST['username'];
$password = $_POST['password'];
$check = '';
//validate CAPTCHA
function rpHash($value) {
$hash = 5381;
$value = strtoupper($value);
for($i = 0; $i < strlen($value); $i++) {
$hash = (($hash << 5) + $hash) + ord(substr($value, $i));
}
return $hash;
}
if (rpHash($_POST['defaultReal']) == $_POST['defaultRealHash']) { ?>
<p class="accepted">You have entered the "real person" value correctly and the form has been processed.</p>
<?php
//if username is not blank
if($username != ''){
//check if username exists already
$query = "SELECT username FROM tbl_user;";
$result = mysql_query($query) or die(mysql_error());
while ($record = mysql_fetch_row($result))
{
foreach($record as $field)
{
if($field == $username){
//if user exists, dont let them add same user
$error_message_username = 'username already used; choose a unique name';
}
else{
$check = 'pass';
}
}
}
}else{
$error_message_username = 'username cannot be blank';
}
//if password is not blank
if($password != ''){
$error_message_password = '';
// encrypt password
$encrypted_password = md5($password);
if($check == 'pass'){
//set username and password into database
$query = "INSERT INTO tbl_user VALUES('','".$username."','".$encrypted_password."');";
$result = mysql_query($query) or die(mysql_error());
}
}else{
$error_message_password = 'password cannot be blank';
}
} else { ?>
<p class="rejected">You have NOT entered the CAPTCHA value correctly and the form has been rejected.</p>
<?php
echo rpHash($_POST['defaultReal']) . '<br/>';
echo $_POST['defaultRealHash'];
}
}
?>
<form method="post" action="SignUp.php">
<p>
E-Mail:
<input type="text" class="required email" id="username" name="username">
<?php
if ( $error_message_username != '' ) {
print "$error_message_username";
}
?>
</p>
<p>
Password:
<input type="text" name="password">
<?php
if ( $error_message_password != '' ) {
print "$error_message_password";
}
?>
</p>
<p>
CAPTCHA:
<input type="text" id="defaultReal" name="defaultReal">
</p>
<p>
<button class="mybutton" type="submit" value="Sign Up">Sign Up</button>
</p>
</form>
最佳答案
Craig Jacobs 说得好,这与您指出的问题相同。我也遇到了同样的事情,并通过如下所示的更改解决了问题:
function rpHash($value) {
$hash = 5381;
$value = strtoupper($value);
for($i = 0; $i < strlen($value); $i++) {
$hash = (leftShift32($hash, 5) + $hash) + ord(substr($value, $i));
}
return $hash; }
function leftShift32($number, $steps) {
$binary = decbin($number);
$binary = str_pad($binary, 32, "0", STR_PAD_LEFT);
$binary = $binary.str_repeat("0", $steps);
$binary = substr($binary, strlen($binary) - 32);
return ($binary{0} == "0" ? bindec($binary) :
-(pow(2, 31) - bindec(substr($binary, 1))));
}
if (isset($_POST['submit'])) {
.....
if (rpHash($_POST['defaultReal']) != $_POST['defaultRealHash']) {
echo "Invalid contact request, please try again with correct verification code...";
exit;
}
.....
.....
}
希望它也能帮助到其他人。
关于javascript - jQuery Real Person - 总是失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20016398/
我在决定是将我的应用程序归类为“实时”还是“接近实时”,或者甚至是其他类别时遇到了麻烦。 该软件会立即接收从源生成的数据,然后根据某些规则,在满足某些条件时发出警报。它采用每 30 秒检查一次最近 3
我的 c 编译器有问题当编译一个简单的hello world时,用户时间是>>>实时的。 这里是两台机器之间的时间比较。 需要注意的是,机器没有执行任何其他任务,其他操作运行得很快(甚至是其他编译器)
虽然我用 C 实现了很多项目,但我对操作系统完全陌生。我在探索板 (STM32) 上尝试了实时 linux,并得到了 LED 闪烁的正确结果,但我并没有真正理解整个过程,因为我只是按照步骤操作,无法在
我的问题是,“可以使用 select type block 来区分 real::realInput 和 real::realArrayInput(:) ?”很清楚 select type 可以如何用于
通过 fortran-iso-c-binding,我可以连接 C 函数并获取类似类型的变量 real(c_float) integer(c_int) 但在程序的其余部分我想使用基本类型(仅仅是因为我不
我正在编写一个应用程序,在某个 block 中我需要对实数取幂大约 3*500*500 次。当我使用 exp(y*log(x)) 算法时,程序明显滞后。如果我使用另一种基于处理数据类型的算法,速度会快
我目前在 science linux 6 下使用 gfortran 4.4.7 编译器。我需要用 128 位声明变量。我无法更改操作系统希望在science linux 6下能做一些事情。 最佳答案
当我在 .NET 中将进程的优先级设置为实时时: Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
我正在使用 Accelerate Framework 在 iOS 中实现基于加速度计的 FFT,但我仍然有点困惑的是这一部分: /* The output signal is now in a spl
用 f(x::Real) 定义函数有什么区别吗?和 f{T <: Real}(x::T) ? @code_warntype给出相同的输出 function f(x::Real) x^2 end
所以我看到了these two questions on twitter . 1.real 是语法错误,而 1 .real 不是? >>> 1.real File "", line 1 1
我有这个简单的代码,它使用 DGEMM 例程进行矩阵乘法 program check implicit none real(8),dimension(2,2)::A,B,C A(1,1)=
如标题所示,我使用了 Media Foundation WavSink 示例,该示例将音频流解码为 PCM 并转储到文件。 我的应用程序是将此流定向到 FMOD 音频引擎,该引擎以实时速率使用 PCM
1) 独占时间是在方法中花费的时间2) 包含时间是在方法中花费的时间加上在任何被调用函数中花费的时间3)我们称调用方法为“ parent ”,称方法为“子”。引用链接:Click here 这里的问题
我正在尝试使用 PS3 Eye 实时执行到达时间差。由于它内置了4个麦克风阵列,我成功地将阵列重新排列成方形阵列,并使用MATLAB对信号进行互相关,得到了一个相对准确的TDOA算法。然而,到目前为止
我开始改进一些旧的 R 代码,发现下一个函数是 deprecated : real创建指定长度的 double 向量。向量的每个元素都等于 0。 as.real试图将其参数强制为 double 类型。
因此,得出以下结论:实时异常检测的定义是什么? 我正在研究异常检测领域,在许多论文中,该方法被定义为实时,而在许多其他论文中,它简称为异常检测。 我碰巧发现,纠正我是否我错了,大多数所谓的实时方法实际
查看所有现有的操作转换框架示例,它们似乎都解决了将更改转换为纯文本文档的问题。 OT 框架如何用于更复杂的对象? 我想开发一个实时便签样式的应用程序,人们可以在其中共同创建便签,更改他们的位置和文本值
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想改善这个问题吗?更新问题,以使为on-topic。 4
我有大量的点数据流(二维)(每秒数千个)。在这张 map 上,我有几个固定的多边形(几十到几百个)。 我想实时确定(在相当强大的笔记本电脑上几毫秒的数量级)它所在的多边形(多边形可以相交)的每个点。我
我是一名优秀的程序员,十分优秀!