PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Coding & Tutorials (http://www.phpdig.net/forum/forumdisplay.php?f=31)
-   -   Noob question about form data (http://www.phpdig.net/forum/showthread.php?t=2241)

irrompible 11-09-2005 11:32 AM

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

Charter 11-10-2005 10:00 PM

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.


All times are GMT -8. The time now is 10:17 PM.

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