restricting text

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

restricting text

Postby Virtuoso » 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: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Re: restricting text

Postby swirlee » 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.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests