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

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)

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.