Advertisement:

Author Topic: [SOLVED] How to make page to go back to homepage after facebook connect ?  (Read 3504 times)

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
 I have noticed that when I add facebook connect on login and registration page it doesn't redirect back to homepage and still remains in login or register page after facebook login or register. This seems odd and I want facebook connect to go homepage, how can I achieve that ? ???
« Last Edit: March 31, 2016, 09:17:10 am by ColdWabmaster »

pecke

  • Full Member
  • ***
  • Posts: 169
Re: How to make page to go back to homepage after facebook connect ?
« Reply #1 on: March 10, 2016, 11:30:27 pm »
add this to redirect to user dashboard or change code to redirect to home page in file user-login.php if you put there facebook login button

Code: [Select]
<?php 
    
if($_GET["state"]!=''){
   
header('Location: /index.php?page=user&action=dashboard' );
   }
   
?>

to home page

Code: [Select]
<?php 
    
if($_GET["state"]!=''){
   
header('Location: /index.php' );
   }
   
?>
« Last Edit: March 10, 2016, 11:33:33 pm by pecke »

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to make page to go back to homepage after facebook connect ?
« Reply #2 on: March 11, 2016, 03:21:45 pm »
Your suggested code redirected the page to my homepage.
but site is a multi site and I have separate directory for classified site.
My bender index.php is located at /public_html/classifieds/oc-content/themes/bender

Now what Can I do ???

pecke

  • Full Member
  • ***
  • Posts: 169
Re: How to make page to go back to homepage after facebook connect ?
« Reply #3 on: March 11, 2016, 04:14:48 pm »
sorry i dont understand ,can you write here url where you want to redirect login and register page and your site url.

ColdWabmaster

  • Full Member
  • ***
  • Posts: 151
Re: How to make page to go back to homepage after facebook connect ?
« Reply #4 on: March 13, 2016, 05:44:08 am »
I just replaced the  header('Location: /index.php?page=user&action=dashboard' )
with  header('Location: /calssified/users/profile' )
 and it worked thanks anyway.

pecke

  • Full Member
  • ***
  • Posts: 169
Re: How to make page to go back to homepage after facebook connect ?
« Reply #5 on: March 14, 2016, 12:24:37 am »
ok then you can mark topic as Solved

edy12

  • Newbie
  • *
  • Posts: 3
Re: How to make page to go back to homepage after facebook connect ?
« Reply #6 on: June 14, 2016, 10:21:14 am »
add this to redirect to user dashboard or change code to redirect to home page in file user-login.php if you put there facebook login button

Code: [Select]
<?php 
    
if($_GET["state"]!=''){
   
header('Location: /index.php?page=user&action=dashboard' );
   }
   
?>

to home page

Code: [Select]
<?php 
    
if($_GET["state"]!=''){
   
header('Location: /index.php' );
   }
   
?>

excuse me sir..
i have install facebook connect plugin.. i use osclass 3.6.1, with osclasswizards theme..

after add the api key and secret key on admin panel, i try to add the code in user-login.php.
but after i login with facebook i got blank page..can u help me where and what else i should add to the file..
here is the ss of the code i add..


thanks a lot for ur help..

pecke

  • Full Member
  • ***
  • Posts: 169
please add original code from my post... your code is wrong dont put code to button