File size: 3.49Kb
<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/pranto007
Script is created and provided by Pranto (http://facebook.com/pranto007)
**************************************/
include '../db.php';
include '../functions.php';
include '../wap/country.php';
headtag("$SiteName - Login");
if($adminlog==1){
header('Location:index.php?login=success');
}
else {
$ispapiurl='http://ip-api.com/json/'.$userip.'';
$ispapich = curl_init();
curl_setopt($ispapich, CURLOPT_URL, $ispapiurl);
curl_setopt($ispapich, CURLOPT_HEADER, 0);
curl_setopt($ispapich, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ispapich, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ispapich, CURLOPT_CONNECTTIMEOUT, 3);
$ispapiinfo=curl_getinfo($ispapich);
$ispapicontentsapi = curl_exec($ispapich);
$ispapicontents=json_decode($ispapicontentsapi);
curl_close($ispapich);
if($ispapicontents->status=='success') {
$city=$ispapicontents->city;
$isp=$ispapicontents->isp;
$ispapilat=$ispapicontents->lat;
$ispapilon=$ispapicontents->lon;
$ispapiorg=$ispapicontents->org;
$state=$ispapicontents->region;
$ispapiregionname=$ispapicontents->regionName;
$ispapitimezone=$ispapicontents->timezone;
$ispapizip=$ispapicontents->zip;
}
if(isset($_POST['user']) AND isset($_POST['user_pwd'])){
$user=formpost("user");
$user_pwd=formpost("user_pwd");
$user_password=md5($user_pwd);
$email='arshadsaifi1999@gmail.com';
$errors=array();
$login_check=mysql_query("SELECT * FROM staff WHERE username='$user'");
if(mysql_num_rows($login_check)<1){
$errors[]='No such user with this username!';
}
else if(mysql_num_rows($login_check)>0){
$login_check2=mysql_fetch_array($login_check);
if($login_check2['pass']!=$user_password){
$errors[]='Password entered was wrong!';
}
}
else if(strlen($user)<1){
$errors[]='Please enter your username!';
}
else if($user!=arshadsaifi){
$errors[]='You are not allowed to login here';
}
else if(strlen($user_pwd)<1){
$errors[]='Please enter your password!';
}
if(empty($errors)){
//$_SESSION['admin_username']=$user;
//$_SESSION['admin_pass']=$user_password;
$hour = time() +(3600*12);
setcookie("admin_username", $user, $hour);
setcookie("admin_pass", $user_password, $hour);
//$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$userip"));
//$city = $geo["geoplugin_city"];
//$state = $geo["geoplugin_regionName"];
//$country = $geo["geoplugin_countryName"];
$mobile="9018242169";
if($isp!='BSNL')
{
$msg = "EarnBuzz VIP Admin Panel Has Been Logged In By User: $user From IP: $userip , ISP: $isp & Location: $city,$state, $country_name";
Send_SMS($mobile,$msg);
}
header('Location:index.php?login=success');
}
else {
echo '<div class="title"><img src="/error.png"/> <font color="red">Login Error:</font></div>';
echo '<div class="error">';
foreach($errors as $error){
echo ''.$error.'<br/>';
}
echo '</div>';
}
}
echo '<div class="title">Log in</div>';
echo '<div class="form"><form action="#" method="post">Username:<br/><input type="text" name="user"/><br/>Password:<br/><input type="password" name="user_pwd"/><br/><div id="forgot"><img src="/forgot.png" alt="?"/> <a href="/user/forgot">Forgot Password?</a></div><input type="submit" value="Login"/></form></div>';
}
echo '<div class="page"><a href="/"> Go Back To Home</a></div>';
include '../foot.php';
?>