Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- if (!isset($_SESSION))
- {
- session_start();
- }
- ?>
- <?php require_once('../Connections/uploader.php'); ?>
- <?
- function accountActivationCheck($activation)
- {
- if ($activation==0){
- $acntactivation = false;
- }
- if ($activation==1) {
- $acntactivation = true;
- }
- if ($acntactivation == false) {
- $acntactivation_error = true;
- }
- return $acntactivation_error;
- }
- function loginFormErrorsCheck ($loginUsername, $loginPassword)
- {
- if (empty($loginUsername)) {$errors = 1;}
- if (empty($loginPassword)) {$errors = 1;}
- return $errors;
- }
- ?>
- <?
- if (isset($_POST['submit'])) {
- $loginUsername = $_POST['uname'];
- $loginPassword = $_POST['pword'];
- $errors = loginFormErrorsCheck ($loginUsername, $loginPassword);
- mysql_select_db($database_uploader, $uploader);
- $query = "SELECT * FROM members WHERE uname='".$loginUsername."' AND pword='".$loginPassword."'";
- $result = mysql_query($query) or die(mysql_error());
- $row = mysql_fetch_array($result) or die(mysql_error());
- $activation = $row['activated'];
- $accountStatus = accountActivationCheck($activation);
- if ($accountStatus == true)
- {
- echo "<span class='error'>Your account has not yet been activated. It will take about two weeks to be fully activated. We will e-mail you when it is.</span>";
- }
- if ($errors==1)
- {
- echo "There were errors! Please make sure you filled in all of the fields.";
- }
- if (!isset($errors))
- {
- header ('Location: $uname/index.php"');
- }
- mysql_close($con);
- }
- ?>
- <!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=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body>
- <h1 align="center"><img src="../Images/user_logout.gif" width="40" height="40" /> Member's Area</h1>
- <p align="center">Please login if you are an existing member, or register on your right.</p>
- <table width="715px" border="3" align="center">
- <tr>
- <td width="300px" valign="middle"><form action="" method="POST" id="form2" name="form2" >
- <table width="300" border="1" cellpadding="5" cellspacing="0">
- <tr>
- <td colspan="3" valign="top" style="padding:15px;">
- <h3>Login</h3>
- Please enter a username to continue being uploading your files:</td>
- </tr>
- <tr>
- <td valign="top">Username: </td>
- <td valign="top"><input type="text" name="uname" id="text" value="<? if (isset($errors)) {echo $_POST['uname'];} ?>"> </td>
- </tr>
- <tr>
- <td valign="top">Password: </td>
- <td valign="top"><input name='pword' type='password' value="<? if (isset($errors)) {echo $_POST['pword'];} ?>" /></span>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="center"><input type="submit" name="submit" id="submit" value="Submit"></form></td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement