Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include("../modules/include/Config.php");
- require_once("../modules/include/Security.php");
- require_once("../modules/include/sqlConn.php");
- mssql_select_db($dbName1, $dbConn) or die ("Couln't select database $dbName1");
- if(isset($_SESSION['loggedin'])) {
- header("location:./../"); //// Problem
- } else {
- if(isset($_POST['submit'])) {
- $check = new security();
- $message = null;
- if($check->is_secure($_POST['username']) == false) $message[] = "";
- if ($check->is_secure($_POST['password']) == false) $message[] = "";
- if(count($message) > 0) {
- for($i = 0; $i < count($message); $i++) {
- print $message[$i];
- header("location:./../?invalidData");
- }
- return;
- } else {
- $username = $_POST['username'];
- $password = md5($_POST['password']);
- $verifyAccount = mssql_num_rows(mssql_query("select * from TB_User where StrUserID = '$username' AND password = '$password'"));
- if($verifyAccount <= 0) {
- header("location:./../?failedLogin");
- } else {
- $_SESSION['loggedin'] = "YES";
- $_SESSION['name'] = $username;
- header("location:./../"); //// Problem2
- }
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment