<?php
$client_id = '******************'; $client_secret = '******************'; $redirect_uri = 'Online Path to/login-hotmail.php'; ?>
Now set URL for Microsoft Live/ Hotmail authentication and link login/
register button to the following URL.
$urls = 'https://login.live.com/oauth20_authorize.srf?client_id='.$client_id.' &scope=wl.signin%20wl.basic%20wl.emails%20wl.contacts_emails &response_type=code&redirect_uri='.$redirect_uri;
$userid = $profile_res['id']; $fname = $profile_res['first_name']; $lname = $profile_res['last_name']; $email = $profile_res['emails']['account'];
if($_POST['register']){ $fname = mysql_real_escape_string($_POST['fname']); $lname = mysql_real_escape_string($_POST['lname']); $email = mysql_real_escape_string($_POST['email']); $passcode = mysql_real_escape_string($_POST['passcode']); $loginwith = mysql_real_escape_string($_POST['loginwith']); $status = 'active'; $mysql = mysql_query("insert into register set fastname = '".$fname."', lastname = '".$lname."', email = '".$email."', passcode = '".$passcode."', loginwith = '".$loginwith."', status = '".$status."'"); header('Location:myaccount.php'); }
CREATE TABLE IF NOT EXISTS `register` ( `userid` int(11) NOT NULL AUTO_INCREMENT, `fastname` varchar(50) NOT NULL, `lastname` varchar(50) NOT NULL, `email` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `passcode` varchar(100) NOT NULL, `loginwith` varchar(20) NOT NULL, `status` varchar(10) NOT NULL, PRIMARY KEY (`userid`), UNIQUE KEY `userid` (`userid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;