forked from mikesanchezdev/nhconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login_old.php
86 lines (73 loc) · 2.69 KB
/
login_old.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php require_once('includes/config.php');
session_start();
if (isset($_SESSION['user'])) {
header('Location: index.php');
}
mysql_select_db($database_follows, $follows);
$pagetitle = Login;
//SET SUCCESS NOTICES
function set_msg($msg)
{
$_SESSION['msg'] = $msg;
}
function display_msg() {
echo $_SESSION['msg'];
unset($_SESSION['msg']);
}
$dis = none;
if (isset($_SESSION['msg'])) {
$dis = block;
}
//
if ($_POST['email'] && $_POST['password']) {
mysql_select_db($database_follows, $follows);
$query_logincheck = "SELECT * FROM follows_users WHERE user_email = '".$_POST['email']."' AND user_password = '".$_POST['password']."'";
$logincheck = mysql_query($query_logincheck, $follows) or die(mysql_error());
$row_logincheck = mysql_fetch_assoc($logincheck);
$totalRows_logincheck = mysql_num_rows($logincheck);
if ($totalRows_logincheck==1) {
$_SESSION['user'] = $_POST['email'];
$redirect = $row_logincheck['user_home'];
header(sprintf('Location: %s', $redirect)); die;
}
if ($totalRows_logincheck < 1) {
set_msg('Incorrect Username or Password');
header('Location: login.php'); die;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $pagetitle; ?></title>
<script src="includes/lib/prototype.js" type="text/javascript"></script>
<script src="includes/src/effects.js" type="text/javascript"></script>
<script src="includes/validation.js" type="text/javascript"></script>
<link href="includes/style.css" rel="stylesheet" type="text/css" />
<link href="includes/simplecustomer.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logincontainer">
<h1><?php echo MINISTRY;?> - Follow-Up System </h1>
<form id="form1" name="form1" method="post" action="">
<span class="notices" style="display:<?php echo $dis; ?>">
<?php display_msg(); ?>
</span></span>Email Address <br />
<input name="email" type="text" size="35" class="required validate-email" title="You must enter your email address." />
<br />
<br />
Password<br />
<input type="password" name="password" class="required" title="Please enter your password." />
<br />
<br />
<input type="submit" name="Submit" value="Login" />
<a href="password.php">Forget password?</a>
</form>
<script type="text/javascript">
var valid2 = new Validation('form1', {useTitles:true});
</script>
<div><a href="http://www.mozilla.com/en-US/firefox/">This site is best viewed with Firefox <img src="images/fox.png" width="60" height="60" border="0" /></a></div>
</div>
</body>
</html>