PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old March 14th, 2003, 08:52 AM
Volitics Volitics is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Location: Knoxville, Tennessee (U.S.A.)
Posts: 58 Volitics User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 15 sec
Reputation Power: 6
How Do I Get PHP To Reject HTML Code From Text Entry Boxes?

How Do I Get PHP To Reject HTML Code From Text Entry Boxes?

Folks;

I am designing a portion of a web site where non-technical users can enter text for news articles. The text will be stored in a MySQL database. I am wanting to place restrictions in the PHP code so that users cannot enter HTML tags into the article text.

Obviously, if users were able to enter HTML tags in the article when the article is extracted from the database and presented on the page any stray HTML tags could mess up the page.

I'm sure that there are different methods that could achieve the same goal but I would like to have suggestions or different points of view.

My question is this: **Does anyone have any suggestions about how I might approach writing or designing the PHP code so that HTML tags will be removed from text before the text is stored in the MySQL database?**

Any opinions or information would be appreciated. Thank you kindly in advance.

Volitics




Reply With Quote
  #2  
Old March 14th, 2003, 09:57 AM
mcps95 mcps95 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 1 mcps95 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
strip_tags function

Try the strip_tags function. URL Simply use this on the string before inserting it into the DB.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > How Do I Get PHP To Reject HTML Code From Text Entry Boxes?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway