Hii Everyone, Here is my code for facebook Signin.i got this example from http://www.codexworld.com/login-with-facebook-using-php/. here is my index page code
PHP code
<?php
include_once("config.php");
include_once("includes/functions.php");
//destroy facebook session if user clicks reset
if(!$fbuser){
$fbuser = null;
$loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$homeurl,'scope'=>$fbPermissions));
$output = '<a class="myLink" href="'.$loginUrl.'">Click Here To Proceed</a>';
}else{
$user_profile = $facebook->api('/me?fields=id,first_name,last_name,email,gender,birthday,picture');
$user = new Users();
$user_data = $user->checkUser('facebook',$user_profile['id'],$user_profile['first_name'],$user_profile['last_name'],$user_profile['email'],$user_profile['gender'],$user_profile['birthday'],$user_profile['picture']['data']['url']);
if(!empty($user_data)){
$output = 'Thanks For Register With Spark.You Should Receive Confirmation Mail Shortly';
}else{
$output = '<h3 style="color:red">Some problem occurred, please try again.</h3>';
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Spark Login with Facebook</title>
<style type="text/css">
h1{font-family:Arial, Helvetica, sans-serif;color:#999999;}
</style>
</head>
<body>
<div>
<?php echo $output; ?>
</div>
</body>
</html>
Here i use a href to show facebook login.after te click of href it will redirecting to facebook login instead automatically want to click and it will redirect the page.Is there any possible way to do that.If anyone know the solution for the problem please help me!!