Check user

Started on the old forum in December 2009 · view the original in the archive · old links redirect here

9 replies · 410 views · started 16 years ago · 1 min read

3 participants
ripkk2tfk Developer · 224 posts #1

Hi, Could one of you guys help me fix my code to check if username exsists, here is what i got

//does username exist?
$check_user="select username from". $db ."where username=".$username;
if($check_user===$username)
{
Echo "already taken!";
}
Else
{
echo "done!";
}
subzero Super moderator Fellow · 3,954 posts #2
//does username exist?
$check = mysql_fetch_array(mysql_query("SELECT username FROM ". $db ." WHERE username='$username' "));
if($check[0]=="$username")
{
Echo "already taken!";
}
Else
{
echo "done!";
}

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #4

i forgot edit one pice userid to username or copy that code again.

Let me know how it workin for you.

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #5

i like doing it this way thou!

if(mysql_num_rows(mysql_query("SELECT username FROM $db WHERE username = '$username'")))
{
$msg=$msg."Userid already exists. Please try another one<br/>";
$status= "NOTOK";
}
// if all validations are fail.
if($status<>"OK")
{ 
echo "$msg";
// if all validations are passed.
}else{ 
echo "That Username is free!";
}

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

ripkk2tfk Developer · 224 posts #6

Ok yea i changed the userid you pasted before to my defined variable 😉 but ok whats the difference between the the methods posted?

subzero Super moderator Fellow · 3,954 posts #7

the one i coded you can add more stuff like email and other stuff like this

if (!stristr($email,"@") OR !stristr($email,".")){
$msg="Your email address is not correct<br/>"; 
$status= "NOTOK";}

if(mysql_num_rows(mysql_query("SELECT email FROM members WHERE email = '$email'"))){
$msg=$msg."Email already exists.<br/>";
$status= "NOTOK";}

You can see the status notok

this will fail the sign up or login.

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Ponick Developer · 216 posts #9

I have a m0top script . Its working fine. But i dont see any cetagory . How to create cetagory??

/* I don't know everything hehe */

Find me on facebook

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close