Jump to content


New Members
  • Posts

  • Joined

  • Last visited

elijahkan14's Achievements


Newbie (1/5)



  1. I'm almost there, I have two tables, one stores unverified users, the other stores all users and has a column labeled "Verified" which is either a 1 or 0. The code is able to check the hash sent in the email link and is able to get as far as deleting the user from the "unverified" table. The code does not change "Verified" from 0 to 1 on the "users" table. $SQL_REQUEST = "SELECT * FROM `unverified` WHERE `Hash`='$Hash'"; $SQL_RESULT = mysqli_query($DB_CON, $SQL_REQUEST); $SQL_VALID = mysqli_num_rows($SQL_RESULT); if($SQL_VALID > 0){ mysqli_query($DB_CON,"UPDATE users SET Verified=1 WHERE Username='$USERNAME'"); mysqli_query($DB_CON,"DELETE FROM `unverified` WHERE `Hash`='$Hash'"); echo '<p>Your account has been activated, you can now login <a href="https://www.site.org/login/">here</a></p>'; mysqli_close($DB_CON); exit(); } else{ die("The hash and/or username you provided was incorrect. If you believe this is an error, please contact customer support."); } Any help would be greatly appreciated.
  2. The following code is what my team uses on our site to allow members to sign up for an account. The person that wrote it is no longer with us. One of the I'm having is im getting people with usernames like ""; show tables; --". I would like to disallow every character except a-z, numbers, _ , and -. Is this possible? The second problem I'm having is that users are no longer able to sign up... they get the error: Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home4/teamct/public_html/join/join-request.php on line 49 It failed. The other problem that existed while the registration still worked is that if the username already existed they get: Fatal error: Call to undefined function mysqli_exit() in /home4/teamct/public_html/join/join-request.php on line 63 If I delete line 63 then the page refreshes without informing the user that anything went wrong. I would like it to say something like "Sorry that username already exists. I have attached the entire join-request file (with usernames/passwords changed for security) Any help would be appreciated, let me know if you need anything else. UPDATE: The registration randomly works again O_o join-request.php
  • 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.