SHARE
TWEET

Untitled

a guest May 31st, 2017 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <?PHP
  3.  
  4. //Database Information
  5.  
  6. $dbhost = "localhost";
  7. $dbname = "quicksco_leader";
  8. $dbuser = "quicksco_hitch";
  9. $dbpass = "123abc";
  10.  
  11. //Connect to database
  12.  
  13. mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
  14. mysql_select_db($dbname) or die(mysql_error());
  15.  
  16.    
  17. $currentpass = $_POST['currentpassword'];
  18. $newpass = $_POST['newpassword'];    
  19. $clanname = $_POST['clanname'];
  20.  
  21.  
  22.  
  23. // lets check to see if the username already exists
  24.  
  25. $checkpassword = mysql_query("SELECT username FROM users WHERE password='$currentpass'");
  26.  
  27. $currentpass_exist = mysql_num_rows($checkpass);
  28.  
  29. if($currentpass_exist > 0){
  30.    
  31. // lf no errors present with the username
  32. // use a query to insert the data into the database.
  33.  
  34. $query = "INSERT INTO users (password, Clan name)
  35. VALUES('$newpass', '$clanname')";
  36. mysql_query($query) or die(mysql_error());
  37. mysql_close();
  38.  
  39. echo "Information has been updated.";
  40.    
  41.  
  42. ?>
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