Jump to content

bsteele11

New Members
  • Posts

    1
  • Joined

  • Last visited

bsteele11's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I know the code for the $username and $password are totally wrong but I can't find the correct code to use and I've gone over the chapter it's suppose to be in (I'm a college student) please please help. The part that is way wrong is bold and underlined but there are probably other errors. Thank you. <?php ob_start(); //research the use of this session_start(); //needed to create sessions - maintaining state is discussed above. ini_set('display_errors', 1); //turn on errors, use for debugging. $username = \"".$UserName."\";"; //refer to the superglobal arrays section above $password = \"".$Password."\";"; $authorized = false; require ('$db'); $sql = 'SELECT * from Login'; $rs = $conn->Execute($sql); //Using a While looping structure to check each record in the database while (!$rs->EOF) { if ($rs->Fields["UserName"]->Value=="$username" && $rs->Fields["Password"]->Value=="$password") { $_SESSION['auth'] = $rs->Fields['Auth']->Value; $_SESSION['username'] = $rs->Fields['UserName']->Value; $authorized = true; } $rs->MoveNext(); } # close the connection $rs->Close(); $conn->Close(); $rs = null; $conn = null; if (!$authorized) { header('Location: login.php'); // see pseudocode for authorize.php exit(); } else { header('Location: index.php'); exit(); } ?>
×
×
  • 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.