Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/28/2018 in all areas

  1. Now you've reverted your change and gone back to the original version, so yes my answer is the same.
    1 point
  2. They will both submit to the same location: the current URL. The only meaningful difference between them is that the first fills in a provided username while the second does not. I would recommend the one that behaves the way you want it to behave.
    1 point
  3. Don't. It is not a "waste" to let your script continue executing. Trying to kill it early is the wrong answer. The only normal reason anyone should ever exit/die in a script is because they're redirecting with header(). No. They both get the same result so it doesn't matter. Perhaps the author didn't know you can have the action empty.
    1 point
  4. you are likely getting that same error when the the login works, but it is probably being hidden by a redirect. since you only use mysqli_stmt_free_result() if you are using mysqli_stmt_store_result(), which you aren't in the posted code, doesn't that mean that you shouldn't be using mysqli_stmt_free_result() at all? you need to switch to the much simpler PDO extension and use exceptions to handled db statement errors. it only takes 4 lines of code to replace the 11 lines you have from the sql query statement through to the fetch statement. $query = "SELECT id,recruits_number,sponsor_username,account_activation_status,id_video_verification_status,id_verification_video_file_url,username,password,primary_domain,primary_website_email,registering_country,registering_ip,registering_browser,registering_os,registering_isp,age_range FROM users WHERE $querying_column = ?"; $stmt = $pdo->prepare($query); $stmt->execute([$login_username_or_email_or_domain]); if(!$row = $stmt->fetch()) { // the email/username was not found // set up the failed login message } else { // the email/username was found, check the activation status and then verify the password hash to finish logging in // the fetched data is in the associative array $row }
    1 point
  5. You aren't using mysqli_stmt_store_result so you don't need mysqli_stmt_free_result. Most of the time PHP scripts run quickly, and since PHP will clean up resources for you automatically at the end you often don't need to worry about cleaning them up yourself.
    1 point
  6. You made the two samples even more similar to each other. If my answer before was "they're basically the same" then that will be even more true now.
    0 points
This leaderboard is set to New York/GMT-04:00
×
×
  • 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.