Help me fix My Login and Register Script
Posted: Tue Oct 20, 2015 2:11 am
I make script login and register,but if login i have one problem this error message 'unable to login !'
My Login Script :
Register script :
Auth script :
Can someone fix it,help me please ...
My Login Script :
Code: Select all
<?php
session_start();
if (!empty($_SESSION['email'])) {
header('location:index.php');
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="google-site-verification" content="WrtKBbvMAd0w_SQ2ib1Nc5PrAlQmUtPGmaITMlNcvCw"/>
<meta name="robots" content="noindex"/>
<title>Login - z0n3x</title>
<link rel="stylesheet" href="../cxEncrypt.php/style/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../cxEncrypt.php/style/css/bootstrap-responsive.min.css"/>
<!--[if !IE]> -->
<link rel="stylesheet" href="../cxEncrypt.php/style/css/style.css"/>
<!-- <![endif]-->
<!--[if IE]>
<link rel="stylesheet" href="../cxEncrypt.php/style/css/style_ie.css" />
<![endif]-->
<script src="../cxEncrypt.php/style/js/jquery.min.js"></script>
<script src="../cxEncrypt.php/style/js/bootstrap.min.js"></script>
<script src="../cxEncrypt.php/style/js/demonstration.min.js"></script>
<script src="../cxEncrypt.php/style/js/application.min.js"></script>
<link rel="shortcut icon" href="../favicon.ico"/>
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png"/>
</head>
<body class='login-body'>
<div class="login-wrap">
<script type="text/javascript">
var uid = '24409';
var wid = '46475';
</script>
<script type="text/javascript" src="http://cdn.popcash.net/pop.js"></script>
<h1><a href="/">z0n3x</a></h1>
<?php
$error = $_GET['error'];
$invalid = $_GET['invalid'];
$success = $_GET['success'];
$bad = $_GET['bad'];
$msg = $_GET['msg'];
$ban = $_GET['banned'];
if ($error) {
echo '<div class="alert alert-error">
<a href="#" class="close" data-dismiss="alert">×</a>
Unable to login. </div>';
} else if ($invalid) {
echo '<div class="alert alert-error">
<a href="#" class="close" data-dismiss="alert">×</a>
Invalid Invite Code. </div>';
} else if ($success == 1) {
echo '<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert">×</a>
kamu sudah mendaftar. segera login sekarang! </div>';
} else if ($success == 2) {
echo '<div class="alert alert-success">
<a href="#" class="close" data-dismiss="alert">×</a>
Your reset password send to your email. </div>';
} else if ($bad) {
echo '<div class="alert alert-error">
<a href="#" class="close" data-dismiss="alert">×</a>
Email not registered. </div>';
} else if ($msg) {
echo '<div class="alert alert-failed">';
echo '<a href="#" class="close" data-dismiss="alert">×</a>';
echo $msg.' </div>';
} else if ($ban) {
echo '<div class="alert alert-error">';
echo '<a href="#" class="close" data-dismiss="alert">×</a>';
echo 'Sorry, You account is tempoary banned. Come back soon!</div>';
}
?>
<div style="color: red;display:none;"></div>
<div class="login">
<form action="/account/login/index.php" method="POST">
<div class="email"><input type="text" name="email" placeholder="Email" class='input-block-level'/></div>
<div class="pw">
<input type="password" name="password" placeholder="Password" class='input-block-level'/>
</div>
<div style="text-align: left !important;">
<input type="checkbox" name="remember" id="remember" style="margin: auto !important; line-height: 20px !important;"/> <label for="remember" style="display: inline !important; line-height: 12px !important; font-size: 12px !important;">Remember me</label>
</div>
<button type="submit" value="masuk" class='button button-basic-darkblue btn-block'>Login</button>
</form>
</div>
<a href="/account/forgot" class='pw-link'>Forget Password ? <span>Click Here!</span> <i class="icon-arrow-right"></i>
<a href="/account/register" class='pw-link'>Not yet Register ? <span>Click Here!</span> <i class="icon-arrow-right"></i></a></br>
</div>
</body>
</html>Register script :
Code: Select all
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="google-site-verification" content="WrtKBbvMAd0w_SQ2ib1Nc5PrAlQmUtPGmaITMlNcvCw"/>
<meta name="robots" content="noindex"/>
<title>Register - z0n3x</title>
<link rel="stylesheet" href="../../cxEncrypt.php/style/css/bootstrap.min.css"/>
<link rel="stylesheet" href="../../cxEncrypt.php/style/css/bootstrap-responsive.min.css"/>
<!--[if !IE]> -->
<link rel="stylesheet" href="../../cxEncrypt.php/style/css/style.css"/>
<!-- <![endif]-->
<!--[if IE]>
<link rel="stylesheet" href="../../cxEncrypt.php/style/css/style_ie.css" />
<![endif]-->
<script src="../../cxEncrypt.php/style/js/jquery.min.js"></script>
<script src="../../cxEncrypt.php/style/js/bootstrap.min.js"></script>
<script src="../../cxEncrypt.php/style/js/demonstration.min.js"></script>
<script src="../../cxEncrypt.php/style/js/application.min.js"></script>
<link rel="shortcut icon" href="http://check.x10host.com/favicon.ico"/>
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png"/>
</head>
<body class='login-body'>
<div class="login-wrap">
<h2>Register z0n3x</h2>
<div style="color: red;display:none;"></div>
<div class="login">
<form action="pc_reg.php" method="POST">
<div class="email"><input type="text" name="email" placeholder="Email" class='input-block-level'/></div>
<div class="pw">
<input type="password" name="password" placeholder="Password" class='input-block-level'/>
</div>
<div>
Invite Code:
<input type="text" name="invite_code" placeholder="Invite Code" class='input-block-level'/>
</div>
<button type="submit" value="Register" class='button button-basic-darkblue btn-block'>Register</button>
</form>
</div>
<a href="http://check.x10host.com/account/" class='pw-link'> <i class="icon-arrow-left"></i> Back to <span>Login</span></a>
</div>
</body>
</html>Code: Select all
<?php
$host = "xo5.x10hosting.com"; //alamat host mysql
$user = "checkx12_z0n3x"; //username mysql
$pass = "sukodono"; //password mysql ()
$db = "checkx12_z0n3x"; //nama database yang digunakan
$connect = mysql_connect($host,$user,$pass); //menghubungkan ke mysql
$sukses = mysql_select_db($db,$connect); //memilih database yang digunakan
?>