Facebook注册 - 重定向到网址,包括一些$响应

时间:2012-01-02 09:06:54

标签: php html facebook forms registration

我正在使用fb:registration插件并将一些数据作为signed_request获取。它的工作正常,但如果用户已存在于我的数据库中,我希望用户使用电子邮件和密码进行验证。因此,我检查电子邮件是否已经存在,如果存在,用户必须填写带有(预先填写的)电子邮件和密码的表单。

我的实际代码是:

$email =$response["registration"]["email"]; 
$emailcheck = mysql_query("SELECT email FROM member WHERE email = '".$email."' LIMIT 1");

if (mysql_num_rows($emailcheck) >0)
   { redirect ('http://www.my-site.de/fbregconfirm.php?go=fbcheck&fbid=$email'); }

在fbregcheck.php上我有以下代码:

<form action="fbregconfirm.php" method="POST">
e-Mail:<input type="text" name="email" value="email"><br>
Password:<input type="text" name="password"><br>
<input type="submit" value="regok">
</form>

当我发送我的实际代码时,网址总是会返回我:

http://www.my-site.de/fbregconfirm.php?go=fbcheck&fbid=$email 

但它应该显示类似

的内容
http://www.my-site.de/fbregconfirm.php?go=fbcheck&fbid=info@example.com

我错了什么?用$ _POST或$ _GET忘了我的东西?

1 个答案:

答案 0 :(得分:1)

PHP不会解析单引号字符串中的变量,所以

redirect ('http://www.my-site.de/fbregconfirm.php?go=fbcheck&fbid=$email');

应该是

redirect ('http://www.my-site.de/fbregconfirm.php?go=fbcheck&fbid=' . $email);