restricting text

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Virtuoso
php-forum Active User
php-forum Active User
Posts: 267
Joined: Mon Jul 21, 2003 7:05 am
Contact:

Tue Jul 22, 2003 10:35 am

How do I make it so that in certain forms, the name can only contain letters and numbers?

Also, how do I disable some html in the forms someone submit. Some, not all.

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Tue Jul 22, 2003 11:13 am

Virtuoso wrote:How do I make it so that in certain forms, the name can only contain letters and numbers?


This will probably require the use of regular expressions, which aren't a picnic to use. Try this page for a reasonably quick primer.

Virtuoso wrote:Also, how do I disable some html in the forms someone submit. Some, not all.


Use strip_tags(), which has an optional argument for allowed tags.
Image

Post Reply