JezK
Edit File: login.php
<?php include "app/useraccess.php"; $userobj=new user(); $site_config =$userobj->getSiteConfig(); if($_SESSION['uid']!='') { header('Location: profile'); } if(isset($_REQUEST['frmlogin'])) { $email=$_POST['username']; $password=$_POST['password']; $op=$userobj->userlogin($email,$password); if($op==101) { echo "<script>window.location.href='profile';</script>"; }else if($op==102) { echo "<script>alert('Your account has been blocked. Please contact administrator');</script>"; } else { echo "<script>alert('Login details are wrong');</script>"; } } require_once('./googlelogin/settings.php'); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>Rural2Global Matrimonial</title> <link rel="icon" type="png" href="img/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="png" href="img/favicon-16x16.png" sizes="16x16" /> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet"> <link href="css/media.css" rel="stylesheet"> </head> <body> <div class="bgimg"> <?php include("innerbanner.php");?> <div class="layerTop"> <div class="container"> <div class="row"> <!-- logo cntr--> <div class="col-sm-2 col-xs-12"> <div class="logoLogin"> <a href='index.php'><img src="img/<?php echo $site_config['web_logo_path']; ?>"></a> </div> </div> <!-- logo cntr--> <!-- right cntr--> <div class="col-sm-10 col-xs-12"> <div class="rowd"> <p class="hdng1">Login</p> <div class="loginbox"> <div class="form-box"> <div class="loginInner"> <form method="POST" action="" autocomplete="off"> <div class="form-group prelative"> <input type="text" class="form-control other customerLog" name="username" autocomplete="off" placeholder="Username" id="username"> <span id="rg1" class="errstyl-l"></span> </div> <div class="form-group prelative"> <input type="password" class="form-control other customerLog" name="password" autocomplete="off" placeholder="Password" id="password"> <span id="rg2" class="errstyl-l"></span> </div> <div class="pass" data-toggle="modal" data-target="#myModal">Forgot Password / E-mail ID ?</div> <!-- for got password modal--> <!-- Modal --> <div id="myModal" class="modal cstm-modal123 forgotmodel fade" role="dialog"> <div class="modal-dialog cstmmodal-dialog1 " style="position:relative;"> <!-- Modal content--> <div class="modal-content cstm-modal-content123 newforgotpasswordmodel"> <button type="button" class="close newforclose" data-dismiss="modal"><img src="img/closefor.png" class=""></button> <div class="modal-body"> <section class="forgotedgeprnt"> <!--<div class="forgotedge"> <img src="img/forgot.png" class="fotpic"> </div>--> </section> <section class="forgotBtm col-md-12"> <h1 class="forgotNew">FORGOT PASSWORD?</h1> <section class="gritterForgt row"> <label>Enter e-mail</label> <div style="position:relative;"> <input type="text" class="fotinupt newforgot" name="femail" id="femail" style="color:#333"> <span id="rg3" class="errstyl" style="color:#fff!important"></span> </div> <div class="text-center homeor"> <div class="orStyle2">or</div> </div> <label>Enter Phone</label> <p> <div style="position:relative;"> <input type="text" class="fotinupt newforgot" name="fphone" id="fphone" style="color:#333"> <span id="rg4" class="errstyl" style="color:#fff!important"></span> </div> </p> </section> </section> </div> <div class="modal-footer cstm-modal-footer"> <div class="text-center"> <input type="button" class="orangeSubbt newfogorangeSubbt" value="Submit" onclick="return validateEmail();" name="sendForgot"> </div> </div> </div> </div> </div> <!-- for got password modal end--> <div class="clearfix"></div> <div class="text-center"> <input type="submit" class="greenSubbt" value="Submit" onclick="return validate()" name="frmlogin"> </div> </form> <div class="clearfix"></div> <div class="text-center homeor"> <div class="orStyle2">or</div> </div> <div class="text-center"> <a href="javascript:void(0)" onclick="return fb_login();"><img class="social" src="img/face.png" ></a> <a href="./twitter/index.php?request=twitter"><img class="social" src="img/twi.png"></a> <a href="<?= 'https://accounts.google.com/o/oauth2/auth?scope=' . urlencode('https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/plus.me') . '&redirect_uri=' . urlencode(CLIENT_REDIRECT_URL) . '&response_type=code&client_id=' . CLIENT_ID . '&access_type=online' ?>"><img class="social"src="img/ggo.png"></a> </div> </div> </div> </div> <div id="fb-root"> </div> </div> </div> </div> </div> </div> </div> </body> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script> <script type="text/javascript"> $('input[type=text]').blur(function(){ $(this).val($.trim($(this).val())); }); function validate() { var err1=0; if ($("#username").val()== "") { $("#rg1").html(''); $("#rg1").html('Required Field'); err1++; } if ($("#password").val()== "") { $("#rg2").html(''); $("#rg2").html('Required Field'); err1++; } if(err1) return false; else return true; } <!--Social FB-Login Start 2021990034684224 client Fb: 173280340005429--> window.fbAsyncInit = function() { FB.init({ appId : '173280340005429', oauth : true, status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); }; function fb_login(){ FB.login(function(response) { if (response.authResponse) { console.log('Welcome! Fetching your information.... '); //console.log(response); // dump complete info access_token = response.authResponse.accessToken; //get access token user_id = response.authResponse.userID; //get FB UID FB.api('/me', function(response) { console.log(JSON.stringify(response)); user_email=''; if(response.email!='' && response.email!='undefined') { user_email = response.email; //get user email } user_name = response.name;//get name user_fbid = response.id;//get Fbid $.ajax({ url: "ajaxcheck", type:"POST", data:"mode="+"FBLogin"+"&user_name="+user_name+"&fbid="+user_fbid+"&usemail="+user_email, success: function(result) { //alert(result); if(result==1) { alert('Your registration successfully completed,update your profile'); window.location.href='updateProfile.php'; } else if(result==2) { alert('Your loggedIn successfully'); window.location.href='profile'; } } }); // you can store this data into your database }); } else { //user hit cancel button console.log('User cancelled login or did not fully authorize.'); } }, { scope: 'publish_stream,email' }); } (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); function validateEmail() { $("span.error").remove(); if($("#femail").val()=="" && $("#fphone").val()=="") { $("#rg3").html(''); $("#rg4").html(''); $("#rg3").html('Required Field'); $("#rg4").html('Required Field'); return false; } else if($("#femail").val()!="") { if(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/ .test($("#femail").val())==false) { $("#rg4").html(''); $("#rg3").html(''); $("#rg3").html('Enter valid email'); $("#femail").focus(); return false; } else { $("#rg3").html(''); $("#rg4").html(''); var email=$("#femail").val(); //alert(email); $.ajax({ url: "ajaxcheck", type:"POST", data:"mode="+"ForgotPassword"+"&email="+email, success: function(result) { //alert(result); if(result==1) { alert('Details sent to your mail'); window.location.href='index.php'; } else { alert('This Emailid not register with R2G'); $("#femail").val(''); } } }); } } else if($("#fphone").val()!="") { if ($("#fphone").val().search(/[^0-9- \s]/) != -1) { $("#rg3").html(''); $("#rg4").html(''); $("#rg4").html('Special Characters Not Allowed'); $("#fphone").focus(); return false; } else if ($("#fphone").val().length > 16 || $("#fphone").val().length < 10) { $("#rg3").html(''); $("#rg4").html(''); $("#rg4").html('Phone Number Must Be In Between 10-16 Digits'); $("#fphone").focus(); return false; } else { var fphone=$("#fphone").val(); $("#rg3").html(''); $("#rg4").html(''); $.ajax({ url: "ajaxcheck", type:"POST", data:"mode="+"ForgotPasswordPhone"+"&fphone="+fphone, success: function(result) { //alert(result); if(result==1) { alert('Details sent to your mobile'); window.location.href='index.php'; } else { alert('This Phone not register with R2G'); $("#fphone").val(''); } } }); } } } </script> <!--Social FB-login End--> </html>