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




    "return_url" => "",     

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



**facebook_login.php** back-end



   $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" => 


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




What I have tried:

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

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

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