3

I built a custom page, more like a landing page with facebook login with permission. What I want is to simply redirect users to home page. My main page is www.ngncareers.com/index.php I built this www.ngncareers.com/index.html as landing page with facebook login. Please how do I redirect users to www.ngncareers.com/index.php after logging into my facebook app via www.ngncareers.com/index.html.

HERE IS MY SOURCE CODE. PLEASE CAN SOMEONE GOOD OUT THERE KINDLY ASSIST ME. I AM JUST A NOVICE ON PHP.

<div id="content">

    <div class="post">
    <h2>Please Login with Facebook</h2>
        <center><div class="fb-login-button" data-size="xlarge" data-show-faces="true" data-scope="email,publish_actions,manage_pages,manage_notifications,user_likes" data-auto-logout-link="false"></div></center> 
    <div id="fb-root"></div>
`window.fbAsyncInit = function() { FB.init({ appId : '78797XXXXXXXXXX', xfbml : true, version : 'v2.0' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));

`

1 Answer 1

0

The first strange fact is that you get an index.html and index.php you can simply have one index.php with html inside.

You can have Pop-in window's style for login into facebook. If you use Javascript, use window.location for a proper redirection.

You should look about "button login Facebook tutorial" which would be really simple. Look also about Facebook developers webpage for more informations and tutorials.

Hope it could help !

3
  • Well I wasn't the one that created the script. I was thinking it would be easy since am a novice in PHP. You suggestion is more complicated. thanks though May 23, 2014 at 9:39
  • developers.facebook.com/docs/plugins/login-button On this link you can set your button and "Get the code" You can't get easier.
    – LouisDev
    May 23, 2014 at 9:42
  • How can I use this attribute "onlogin" function to my advantage in solving this. They said this is A JavaScript function to trigger when the login process is complete. can this do the redirect. And how can it be done. Can a guru here please help me out? May 23, 2014 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.