Philipp K aus M.
Philipp K aus M.

Reputation: 86

facebook registration - redirect to url including some $response

I'm using the fb:registration Plugin and get some data as signed_request. Its all working fine but if a user already exists in my database i want the user to validate with email and password. Therefore I check if the email already exists and if exist the user has to fill a form with (prefilled) email and password.

Inhere is my actual code:

$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'); }

on fbregcheck.php i have the following code:

<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>

When i rund my actual code the url always returns me:

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

but it should show something like

http://www.my-site.de/fbregconfirm.php?go=fbcheck&[email protected]

What do I wrong? Forgot I something with $_POST or $_GET?

Upvotes: 0

Views: 280

Answers (1)

Flygenring
Flygenring

Reputation: 3848

PHP doesn't parse variables in single-quoted strings, so

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

should be

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

Upvotes: 1

Related Questions