PhpDig.net

Go Back   PhpDig.net > General Forums > Coding & Tutorials

Reply
 
Thread Tools
Old 11-09-2005, 12:32 PM   #1
irrompible
Green Mole
 
Join Date: Nov 2005
Posts: 1
Noob question about form data

When ever I use ' or " in a form text box and display it back on the page using php it appears with a \ in front of it. Is there anyway to avoid this extra character being added?

For example: "What's Up" entered into a text box would be displayed on the page as "What\'s Up
irrompible is offline   Reply With Quote
Old 11-10-2005, 11:00 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Use htmlspecialchars(stripslashes($foo),ENT_QUOTES) when echoing form field input back onscreen. Use urlencode(stripslashes($foo)) when forming a link. Also check out this page for more tips and examples related to PHP and HTML output.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply


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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Config on windows box- Document contains no data jozzy Troubleshooting 3 08-22-2005 07:36 AM
Re-indexing Data Base Fast ezytrak Troubleshooting 1 03-15-2005 10:01 AM
How to use form data to create XML??? retrodog Coding & Tutorials 1 03-15-2005 09:45 AM
Request: Meta-Data ~ jeremiah Mod Requests 1 07-14-2004 08:55 PM
Searching data in MySQL database maheshg How-to Forum 3 03-24-2004 11:21 AM


All times are GMT -8. The time now is 11:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.