PHP Validation

Hey guys.

I have a form with a quantity text box called ult_qty. I need this to display an error msg if the value is anything but a number and if it is empty.

Also, I have a text box called creditcard. Someone enters all 16 digits, and when it posts, I need it to only how the last 4 of the card number. I am so cofused with the string length/string position stuff.

Can I get some help?

Yes you can :)

is_numeric() and substr() will provide you with any information you need.

Perfect, works great.

1 last question.

I have a txt box which needs to be 16 numbers. how can I validate so under 16 numbers it comes back with an error msg?

Thanks again for the help.

strlen() perhaps? You should check out more often ;)

Sponsor our Newsletter | Privacy Policy | Terms of Service