Jump to content

2 questions


Emperio

Recommended Posts

Hi all,

I need some help with some PHP code.

I want to know how i can check if user exists or not.

for example in my mysql there is a user named tester1

someone want to attack a player so he types his name like tester3, I want PHP to check if this row exists or not.

So when he types tester3 instead of tester1 there must come a message like "wrong username";

 

Link to comment
https://forums.phpfreaks.com/topic/195854-2-questions/
Share on other sites

usually in multiuser systems, there would be a database table that holds user information. if someone wants to interact with another user, they input the username then your code should check if that username exists in the user information table in the database.

if it exists, continue the action

else output error (unknown username), handle the error (ask user to input username again) or abort with error.

Link to comment
https://forums.phpfreaks.com/topic/195854-2-questions/#findComment-1028852
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.