Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 6th, 2006, 04:54 PM
Registered User
Join Date: Sep 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default posting html code via a form php

I need to know how to allow users to input html code into a form and allow them to submit the code. I want to store it in a database for later use.

What happens now is when i input data and submit the form, all the html tags are gone so only non html text is present.

I guess i need to know how to disable stripping of html tags by php or whatever is doing it.

Reply With Quote
  #2 (permalink)  
Old September 12th, 2006, 01:22 AM
Registered User
Join Date: Sep 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

There are two functions in PHP3/4/5 named
1.string strip_tags ( string str [, string allowable_tags] )
2.string htmlspecialchars ( string string [, int quote_style [, string charset]] )

If you use
$name = strip_tags("<b>Zia</b>") and insert into $name in Database, the output will be "Zia"
If you use
$name = htmlspecialchars("<b>Zia</b>") and insert into $name in Database, the output will be "<b>Zia</b>" means bold "Zia"

Please let me know whether it works.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP code to insert values from HTML form to SQL se rbyamukama Pro JSP 3 January 29th, 2013 07:42 AM
register.php: clearing html form fields lamada BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 26th, 2004 01:25 PM
Posting message via HTTP to a PHP script ThaYoung1 Biztalk 0 February 9th, 2004 05:03 AM
HTML: <FORM> embedded in code valentino HTML Code Clinic 1 July 9th, 2003 10:05 AM

All times are GMT -4. The time now is 05:59 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.