Jump to content

manch889

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by manch889

  1. <form method="post" action="../php/tlogin.php" name="form" onsubmit="return validated()" ><br></br> <lable> Username</lable> <input type="text" placeholder="Enter Username" name="username" id="uname" required> <div id="uname_error">Please Fill Up your Username</div> <br></br> <lable>Password</lable> <input type="password" placeholder="Enter Password" name="tpw" id="tpw" required><br></br> <div id="pass_error">Please Fill Up your Password</div> <br></br> <button type="Submit" name="login">Login</button><br></br> <a href="#">Lost Your Password?</a><br> <a href="#">Don't have an account?</a> </form>
  2. Notice: Undefined index: username in C:\xampp\htdocs\IWT Assigment - Copy\php\tlogin.php on line 6
  3. <?php require 'config.php'; if (isset($_POST['login'])) { $password = mysqli_real_escape_string($con, $_POST['tpw']); $username= mysqli_real_escape_string($con, $_POST['username']); $query = "SELECT * FROM tinfo WHERE username='$username' AND password='$password'"; $results = mysqli_query($con, $query); if (mysqli_num_rows($results) == 1) { $_SESSION['username'] = $username; $_SESSION['success'] = "You are now logged in"; header('location: ../html/register.html'); }else { echo "Wrong username/password combination"; } } ?>
×
×
  • 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.