Jump to content

wleorule

New Members
  • Posts

    4
  • Joined

  • Last visited

  • Days Won

    1

wleorule last won the day on February 22 2015

wleorule had the most liked content!

wleorule's Achievements

Newbie

Newbie (1/5)

2

Reputation

  1. My advice is to use ajax to submit POST request to script that will keep track of users. e.g: $(document).ready(function(){ var username = <?php echo $username; ?>; function check_online() { $.post('check_if_online.php', { user: username}, function(x){ $(".my_online_table_div").html(x) // In 'x' I return table with online users }); setTimeout(function() { check_online(); }, 3000); // Check again after 3 sec } check_online(); }); And in check_if_online.php you can use a db for storing your online users or a file...
  2. Add your hash function after IF LOOP (don't hash password until you check its raw lenght), like this: if(strlen($username) <3 || strlen($username) >30) { die("Your username must be 3 - 30 characters."); } else if(strlen($password) <3 || strlen($password) >30) { die("Your password must be 3 - 30 characters."); } // Now I will hash $password $password = hash('ripemd128', $password);
  3. Add your hash function after ELSE IF loop like this: if(strlen($username) <3 || strlen($username) >30) { die("Your username must be 3 - 30 characters."); } else if(strlen($password) <3 || strlen($password) >30) { die("Your password must be 3 - 30 characters."); } else { }
  4. There is no variable called $password I think you can do it this way: $cpass = hash('ripemd128', $cpass); $currentpass = hash('ripemd128', $cpass); $oldpasswd = "SELECT COUNT(password) FROM users WHERE username='$username' AND password='$currentpass'"; // We check if there is user with that username and password (old password) $opwd = mysqli_query($oldpasswd, $con); $result = mysql_result($opwd, 0); // If result is = to 1 then old password is correct if($result != 1) { die("Your old password is not correct."); } else { .... Hope that helps
×
×
  • 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.