daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?PHP
  2. if (!isset($_POST[use1]) || !isset($_POST[pas])) {
  3.     $dec=0;
  4.     }
  5.     elseif (empty($_POST[use1]) || empty($_POST[pas])) {
  6.     $dec=0;
  7.     }
  8.     else{
  9. $user = $_POST['use1'];
  10. $pass = $_POST['pas'];
  11. //set the database connection variables
  12. $dbHost = "localhost";
  13. $dbUser = "root";
  14. $dbPass = "";
  15. $dbDatabase = "foresightdb";
  16. $db = mysql_connect("localhost","root","") or die("could not connect");
  17. mysql_select_db("$dbDatabase", $db) or die ("Couldn't select the database.");
  18. $result=mysql_query("select * from reguser where use1='$user' AND pas='$pass'", $db);
  19. $rowCheck = mysql_num_rows($result);
  20. if($rowCheck > 0){
  21. while($row = mysql_fetch_array($result)){
  22.   session_start();
  23.   $_SESSION['use1'] = $user;
  24.   $dec=1;
  25.   }
  26.   }
  27.   else {
  28.   $dec=0;
  29.   }}
  30.   ?>
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
 
Top