Jump to content

Login Session_Start


vasoftwaresolutions

Recommended Posts

For some reason this will not let me login.. you can see the error if you login

 

here is the page.. http://globalskyairlines.com/pilots

 

user = BLUE101

password = 833699

 

thanks for any help!

here is my source

 

<?php
$hostname = "localhost";   
$database = "globalsky_bluehawaiian"; 
$username = "bluehawaiian"; 
$password = "8336994895"; 
$vrbo = mysql_connect($hostname, $username, $password) or die(mysql_error()); 
?>

<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
  session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
  $_SESSION['MM_redirectLoginSuccess'] = $_GET['accesscheck'];
}

if (isset($_POST['username'])) {
  $username=$_POST['username'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "overview.php";
  $MM_redirectLoginFailed = "index.php?M=Login Failed";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database, $vrbo);
  
  $LoginRS__query=sprintf("SELECT callsign, password FROM pilots WHERE callsign=%s AND password=%s",
    GetSQLValueString($username, "text"), GetSQLValueString($password, "text")); 
   
  $LoginRS = mysql_query($LoginRS__query, $vrbo) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $username;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['MM_redirectLoginSuccess']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['MM_redirectLoginSuccess'];	
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<!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>Blue Hawaiian Login</title>
<style type="text/css">
<!--
.style1 {color: #C0C0C0}
-->
</style>
</head>

<body>
<span class="style1"><br />
</span><br />
<br />
<form id="form1" name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
          <table width="100%" border="0">
            <tr>
              <td>Callsign:</td>
            <td><label>
            <input type="text" name="Username" id="Username" />
              </label></td>
            </tr>
            <tr>
              <td>Password:</td>
              <td><input type="password" name="password" id="password" /></td>
            </tr>
            <tr>
              <td height="23"> </td>
              <td> </td>
            </tr>
            <tr>
              <td height="23"> </td>
              <td><label>
                <input type="submit" name="button" id="button" value="Login" />
              </label></td>
            </tr>
          </table>
</form>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.