Jump to content

[SOLVED] if(substr etc ||| How to tell if username is under limit and display error?


Technex

Recommended Posts

Hey guys I javascript:void(0);

Coolhope you can guess what I'm trying to do just by seeing this:

 

if(substr($_POST['regusername'],0,25)==TRUE){

echo 'Username is good under 25';

}else{

echo 'Username is bad more than 25';

}

 

 

 

Just doesn't work I think what I'm trying to == to is wrong.

 

Thanks!  :D

Link to comment
Share on other sites

Sorry lemme explain it more.

 

 

I already know how to limit the username by using this: $regusername = substr($_POST['regusername'],0,25);

 

But if a user goes over this limit it just cuts there username down to 25 and doesn't tell them or stop them from registering. How can I display a error and stop the code?

 

 

(by using a if statement if possible)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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