SHARE
TWEET

Untitled

a guest Jun 16th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $username = $_POST['txt1'];
  4. $password  = $_POST['txt2'];
  5.  
  6. if(empty($username) || empty($password)){
  7.     echo "<script>alert('Llena todos los campos!');</script>";
  8. }
  9. else{
  10.     $tsql = "SELECT * FROM CatUsuarios WHERE U_UsdName='$username' AND U_Password='$password' LIMIT 1";
  11. }
  12. $stmt = sqlsrv_query( $conn, $tsql);
  13. while($Row=sqlsrv_fetch_array($stmt)){
  14.     if($stmt == true){
  15.         $_SESSION['valid_user'] = true;
  16.         $_SESSION['usuario'] = $username;
  17.         header('Location: index.php');
  18.         die();
  19.     }else{
  20.         header('Location: error.html');
  21.         die();
  22.     }
  23. }
  24.  
  25. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top