Jump to content

erickreno

New Members
  • Posts

    3
  • Joined

  • Last visited

erickreno's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks ginerjm, I thought it might be a strange issue, but went through all the white space on the page again and found a single space that was hiding behind a tab.
  2. First thing I thought about, even recreated the file manually to make sure I wasn't missing any errant characters. The fact that the header() is after the session_start() is the part that is strange. Also checked all include files to make sure no errant characters. I use the same script for student's login with no issues.
  3. I am having an issue I cannot figure out. Been looking at it for 3 days now and I don't see anything wrong, maybe you can help. When I run the script, the form comes up and works well, when I submit it I get the following PHP error message: header() comes after the session_start() but it's still telling me there is an issue. The include files all work and have no spaces or echo commands, they are used in another part of the site and work fine. Here is the code: <?php include_once('../includes/connectvars.php');?> <?php include_once('../functions/globalFunctions.php');?> <?php $webID = ''; $password = ''; $sendForm = ''; // * Form Processing * if(isset($_POST['username'], $_POST['password'])){ $webID = $_POST['username']; $password = $_POST['password']; // * Validate login * if(validateLoginAdmin($webID, $password, $conn) == false){ $sendForm = false; }else{$sendForm = true;} // * Good to go? Start Session * if($sendForm == true){ //include_once('startSessionAdmin.php'); session_start(); $query = "SELECT * FROM adminlogin WHERE adminuser = '$webID' limit 1"; $result = mysqli_query($conn, $query); $row = $result->fetch_assoc(); $_SESSION['firstName'] = $row['firstName']; $_SESSION['lastName'] = $row['lastName']; $_SESSION['login'] = 1; $_SESSION['admin'] = 2; $_SESSION['username'] = $webID; header('Location:admin_landing.php'); exit(); }} ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Login</title> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"> <link rel="stylesheet" href="../css/login.css"> </head> <body> <div class="login"> <h1>Enrichment Week Admin Login</h1> <form action="index.php" method="post"> <label for="username"> <i class="fas fa-user"></i> </label> <input type="text" name="username" placeholder="Username" id="username" required> <label for="password"> <i class="fas fa-lock"></i> </label> <input type="password" name="password" placeholder="Password" id="password" required> <input type="submit" value="Login"> </form> </div> </body> </html> What am I missing?
×
×
  • 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.