Click here to Skip to main content
15,669,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 3 pages. config.php, login.php and facebook_login.php.I set redirect url in config.php. When users logged in via facebook the pages redirect to home. Because I have multiple login button into pages when users come to login.php depends on what button they click on I would like to redirect users different pages from login.php to facebook page. Such as to index.page , admin.page or product page etc. How can I redirect users in the light what I have just told?

PS:Array config.php or $Config['return_url']) in facebook_login.php might be problem.

thanks..

**config.php**

 "https://www.example.com/login",    

    "return_url" => "https://www.example.com/home",     

"facebook" => array(
        "Statu" => 1, 
        "app_id" => "",
        "app_secret" => "",     
        "default_graph_version" => "v2.5",      
     ),
)

?>
 **login.php**

facebook<a>";

?>
**facebook_login.php** back-end

get('me?fields=id,name,email';

   $accessToken);

   $UserData = $UserData->getGraphNode()->asArray();

   $data = array();

   $data['oauth'] = "facebook"

   $data['uid'] = $UserData['id'];
 
   $data['name'] = $UserData['name'];

   $_SESSION['loginer'] = array("uid" => $data['uid'], "name" => $data['name'], "oauth" => 

   $data['oauth']);
 
   unset($_SESSION['FBRLH_state']);

   header("location: ".$Config['return_url']);

   exit();

} 

?;


What I have tried:

if (!isset($_SESSION['loginer'])) {

header("location: product.php");
Posted
Updated 7-May-23 21:22pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900