Created
December 2, 2013 20:16
-
-
Save PintuKumarPal/7758016 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
<cfset api_key = "408300609288755"/> | |
<cfset secret_key = "86f3386be0df8c40dab97c8af3c0d237"/> | |
<cfset appID = "408300609288755"/> | |
<cfhttp url="https://graph.facebook.com/oauth/access_token" result="GetAccessToken"> | |
<cfhttpparam name="client_id" value="#appID#" encoded="no" type="url"> | |
<!--- Form here You can redirect your page on dashboard (After Login Page) ---> | |
<cfhttpparam name="redirect_uri" value="http://www.thefutureminders.com/facebooklogin/loginInformation.cfm" encoded="no" type="url"> | |
<cfhttpparam name="client_secret" value="#secret_key#" encoded="no" type="url"> | |
<cfif IsDefined('url.code')> | |
<cfhttpparam name="code" value="#url.code#" encoded="no" type="url"> | |
</cfif> | |
</cfhttp> | |
<cfif IsDefined('url.code')> | |
<cfhttp url="https://graph.facebook.com/me?#GetAccessToken.filecontent#" result="loginInformation"></cfhttp> | |
<cfset response = DeserializeJSON(loginInformation.filecontent) /> | |
<cfdump var = "#response#"> | |
<br /> | |
<br /> | |
<!--- This Information Is Used for insert in database ---> | |
<br /> | |
<br /> | |
<!---Member Login Information ---> | |
<table> | |
<tr> | |
<td>FaceBookUID</td> | |
<td>#response.id#</td> | |
</tr> | |
<tr> | |
<td>FaceBook ID</td> | |
<td>#response.link#</td> | |
</tr> | |
<tr> | |
<td>Name</td> | |
<td>#response.name#</td> | |
</tr> | |
<tr> | |
<td>Email</td> | |
<td> | |
#response.email# | |
<cfset Email="#response.email#"> | |
</td> | |
</tr> | |
<tr> | |
<td>First Name</td> | |
<td> | |
#response.first_name# | |
<cfset FirstName="#response.first_name#"> | |
</td> | |
</tr> | |
<tr> | |
<td>Last Name</td> | |
<td>#response.last_name# | |
<cfset LastName="#response.last_name#"> | |
</td> | |
</tr> | |
<tr> | |
<td>Gender</td> | |
<td>#response.gender# | |
<cfif response.gender EQ "male"> | |
<cfset Gender=1> | |
<cfelse> | |
<cfset Gender=0> | |
</cfif> | |
</td> | |
</tr> | |
<cfif IsDefined('response.birthday')> | |
<tr> | |
<td>Birthday</td> | |
<td>#response.birthday# | |
<cfset BirthDate="#Day(response.birthday)#"> | |
<cfset BirthMonth="#left(MonthAsString(Month(response.birthday)),3)#"> | |
<cfset BirthYear="#Year(response.birthday)#"> | |
<cfelse> | |
<cfset BirthDate=""> | |
<cfset BirthMonth=""> | |
<cfset BirthYear=""> | |
</td> | |
</tr> | |
</cfif> | |
<cfif IsDefined('response.hometown.name')> | |
<tr> | |
<td>HomeTown</td> | |
<td>#response.hometown.name# | |
<cfset BirthCityNumber="#response.hometown.name#"> | |
<cfelse> | |
<cfset BirthCityNumber=""> | |
</td> | |
</tr> | |
</cfif> | |
<cfif IsDefined('response.relationship_status')> | |
<tr> | |
<td>Marital Status</td> | |
<td>#response.relationship_status#</td> | |
</tr> | |
</cfif> | |
<cfif IsDefined('response.location.name')> | |
<tr> | |
<td>Location</td> | |
<td>#response.location.name# | |
<cfset LivingCityNumber="#response.location.name#"> | |
<cfelse> | |
<cfset LivingCityNumber=""> | |
</td> | |
</tr> | |
</cfif> | |
<cfif IsDefined('response.bio')> | |
<tr> | |
<td>AboutMe</td> | |
<td>#response.bio#</td> | |
</tr> | |
</cfif> | |
</table> | |
</cfif> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment