Reply
max characters variable
Old 09-26-2007, 04:56 AM max characters variable
Average Talker

Posts: 20
Hello,

How can i add a max character limit to a variable?

So if the var the user inputs is too long, it stops the procedure. else, continue.

Thanks in advance
koolaid is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 09-26-2007, 05:13 AM Re: max characters variable
tripy's Avatar
Fetchez la vache!

Posts: 1,855
Name: Thierry
Location: In the void
PHP Code:
if(strlen($var)>$limit){
  echo(
'naughty boy!');
  exit();
}
else{
  ....

Or in html, on the <input> tags, you have a "maxlength" attribute that specify the maximum number of characters the user can type.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to max characters variable
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13082 seconds with 13 queries