Вопрос

The first page of the application passes a value over to the next page using a text box. If the user isn't logged in then it will display a login link that will allow them to do so. Whenever they click the link the page will refresh which drops the value for the variable passed over from the first page.

This is the code for the input box on the first page (HTML)

<form action="verify.php" METHOD=post>
Enter a School: 
<input type="text" name="school" /> 
<INPUT TYPE=SUBMIT VALUE="GO">
</form> 

This is the code for the second page to check if they are logged in or not (PHP)

$user = $facebook->getUser();
if ($user == 0){
    $loginUrl = $facebook->getLoginUrl();
    echo ( '<b>Please <a href="'.$loginUrl.'">Login</a> before proceeding.</b>' );
    echo ( '<br />' );
Это было полезно?

Решение

Store the value you need to save before/after login in a session variable, or apprend it to the variables used in your redirect_uri (generated in the getLoginUrl() function)

Bear in mind you'll need to keep the same redirect_uri value when you exchange the code for an access_token in the second step of the server side auth

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top