1 rizwank 1.1 <?php
2 session_start();
3 // Check if the user hasn't logged in
4 if (!isset($_SESSION["login"]) || (!isset($_SESSION["loginIP"]) || ($_SESSION["loginIP"] != $_SERVER["REMOTE_ADDR"])))
5 {
6 ?>
7 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8 <html xmlns="http://www.w3.org/1999/xhtml">
9 <head>
10 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
11 <title>SSP Admin Login</title>
12 <link rel="stylesheet" href="styles/main.css" />
13 <style type="text/css">
14 p {
15 text-align:center;
16 }
17 </style>
18 </head>
19
20 <body>
21 <div id="container">
22 rizwank 1.1 <h1>SSP Admin</h1>
23
24 <?php
25 if (isset($m))
26 {
27 switch($m)
28 {
29 case 1:
30 $alert = 'Invalid Login, Please Try Again';
31 break;
32
33 case 2:
34 $alert = 'No Current Session Found. Please Log In Again.';
35 break;
36
37 case 3:
38 $alert = 'Session Began from a Different IP Address. For security reasons, please log on again.';
39 break;
40
41 case 4:
42 $alert = 'You Have Successfully Signed Out.';
43 rizwank 1.1 break;
44
45 case 5:
46 $alert = 'The changes to your user profile have been made. You can now sign in with your updated information.';
47 break;
48 }
49 ?>
50 <p class="update-msg"><small><?php echo $alert ?></small></p>
51 <?php
52 }
53 else {
54 ?>
55 <p>Login below to begin</p>
56 <?php }; ?>
57 <form method="post" action="login.php">
58 <fieldset class="center">Username: <input type="text" name="Usr" /></fieldset>
59 <fieldset class="center">Password: <input type="password" name="Pwd" /></fieldset>
60 <fieldset class="center"><input type="submit" value="Login Now" /></fieldset>
61 </form>
62 </div>
63 </body>
64 rizwank 1.1 </html>
65 <?php
66 } else {
67 header("Location: index.php");
68 }
69 ?>
|