index.php 1.6 KB
<?php
//Always place this code at the top of the Page
session_start();
if (isset($_SESSION['id'])) {
    // Redirection to login page twitter or facebook
    header("location: home.php");
}

if (array_key_exists("login", $_GET)) {
    $oauth_provider = $_GET['oauth_provider'];
    if ($oauth_provider == 'twitter') {
        header("Location: login-twitter.php");
    } else if ($oauth_provider == 'facebook') {
        header("Location: login-facebook.php");
    }
}
?>
<html>
<head>
<title>9lessons Facebook | Twitter Login</title>
<style type="text/css">
    #buttons
	{
	text-align:center
	}
    #buttons img,
    #buttons a img
    { border: none;}
	h1
	{
	font-family:Arial, Helvetica, sans-serif;
	color:#999999;
	}
	
</style>
<script type="text/javascript" src="http://userapi.com/js/api/openapi.js?34"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script>
VK.init({apiId: 3078252}); // __APP_ID__ - èäåíòèôèêàòîð ïðèëîæåíèÿ
</script>
</head>

<body>
<div id="buttons">
<h1>Twitter Facebook Login </h1>
    <a href="?login&oauth_provider=twitter"><img src="images/tw_login.png"></a>&nbsp;&nbsp;&nbsp;
    <a href="?login&oauth_provider=facebook"><img src="images/fb_login.png"></a> <br />

<a href="http://oauth.vk.com/authorize?client_id=3079859&scope=&redirect_uri=http://extremstyle.ua/social/login-vkontakte.php&response_type=code" onClick="">Âîéòè ÷åðåç ÂÊîíòàêòå</a>

 <div id="vk_auth" style="visibility:hide;"></div>
<script type="text/javascript">
VK.Widgets.Auth("vk_auth", {width: "300px", authUrl: '/social/login-vkontakte.php?'});
</script>


</div></body><html>