Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

restricting text

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
Virtuoso
php-forum Active User
php-forum Active User
 
Posts: 268
Joined: Mon Jul 21, 2003 7:05 am

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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back


Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.