Jump to content

Lucky2710

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://nodinelandscaping.com

Profile Information

  • Gender
    Male
  • Location
    SC

Lucky2710's Achievements

Member

Member (2/5)

0

Reputation

  1. I figured it out i ditched my first idea when i figured out people were doing this on a link with auto-redirect. Step 1: Initialize the javascript sdk Step 2: Put a link to logout Code for link -------------------- <a href="#" onclick="javascript:FB.logout(function() { window.location='PUT YOUR REDIRECT URL HERE' }); return false;">Logout</a> NOTE: I am running the facebook login as a parrallel login to my websites current php login system so my redirect url went to a page that runs (almost in the background) to destroy my php session and then again auto redirects back to my index page. By doing it this way in the users ONE click it logs them completely out of both facebook and my website Code for my redirect (aka. my website log out) -------------------------------------------------------------- <?php include_once('framework/checkuserlog.php'); ?> <script> function killSession(){ var code = "<?php session_destroy();?>"; return (code); } killSession(); </script> <script> location.href='index.php'; </script>
  2. I'm using facebook connect as an alternative login method for my users on my website. (ex forget your credentials to my website use your facebook credentials) Ive got the facebook login working and ive got it working in conjunction with my login system. In facebooks terms and conditions you have to include a facebook logoff if you have a facebook login on your website. I have managed to get it to logoff on a <button></button> But thats the oinly way i can get it to work! I need it to run automatically on my logout script page. My current Logout.php (NOTE: Only kills the session and logs out of my php login script THE JAVASCRIPT DOES NOT WORK CORRECTLY AND LOGOUT OF FACEBOOK LIKE ITS SUPPOSED TO) <?php include_once('framework/checkuserlog.php'); ?> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: 'APP_ID_HERE', status: true, cookie: true, xfbml: true}); FB.logout(function(response) {}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); </script> <?php session_destroy(); ?> <script> location.href='index.php'; </script> Working Script To Logout on a <button> <div id="fb-root"></div> <script type="text/javascript"> var button; var userInfo; window.fbAsyncInit = function() { FB.init({ appId: 'APP_ID_HERE', status: true, cookie: true, xfbml: true, oauth: true}); showLoader(true); function updateButton(response) { button = document.getElementById('fb-auth'); userInfo = document.getElementById('user-info'); if (response.authResponse) { //user is already logged in and connected FB.api('/me', function(info) { login(response, info); }); button.onclick = function() { FB.logout(function(response) { logout(response); }); }; } else { //user is not connected to your app or logged out button.innerHTML = 'Login with Facebook'; button.onclick = function() { showLoader(true); FB.login(function(response) { if (response.authResponse) { FB.api('/me', function(info) { login(response, info); }); } else { //user cancelled login or did not grant authorization showLoader(false); } }, {scope:'email,user_birthday'}); } } } // run once with current status and whenever the status changes FB.getLoginStatus(updateButton); FB.Event.subscribe('auth.statusChange', updateButton); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }()); function login(response, info){ if (response.authResponse) { var accessToken = response.authResponse.accessToken; userid = response.authResponse.userID; userInfo.innerHTML = ''; button.innerHTML = 'Logout'; showLoader(false); document.getElementById('other').style.display = "block"; } } function logout(response){ userInfo.innerHTML = ""; document.getElementById('debug').innerHTML = ""; document.getElementById('other').style.display = "none"; showLoader(false); } function showLoader(status){ if (status) document.getElementById('loader').style.display = 'block'; else document.getElementById('loader').style.display = 'none'; } </script> <button id="fb-auth">Login with Facebook</button> <div id="loader" style="display:none"></div> <div id="user-info"></div> <div id="debug"></div> <div id="other" style="display:none"></div> Stuff that might help with a solution ------------------------------------------------ All Facebook connect code is using facebooks javascript sdk loaded Asynchronously All my traditional custom built login script is built in php and is almost 100% mysql database driven Server:Apache/2.0.52 (Red Hat) MySQL Server: Version 5.1.42
  3. Oooo Ya! now i remember now. Thanks
  4. I've done this before I just can't remember how will someone point me in the right direction? Thanks Say you have this url http://myurl.com/page.php?code=AQBpGFUngD How can i pull the ''code" variable from the url back into a php variable that i can use it again on my page? Thanks ahead of time!
  5. I'm not sure if this question is better asked here or in the 'other' category in client side but that category of forums has less traffic so i'm posting here. I am trying to mix php, mysql, and flash all togather. In mysql ive got a table with information regarding my photo gallery (columns are like 'id' 'location' 'date' 'uploader' ect) I am using php to pick 5 random pictures and return those 5 picture locations into 5 different php variables. NOW MY ISSUE: How can I send those 5 php variables into flash (as3) as 5 as3 variables??? Any help would be appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.