SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: The < in a record
-
Nov 30, 2009, 22:44 #1
The < in a record
Hey guys,
Whenever I use a < character on a string field it will convert it to < and > for the greater than sign.
Is there a way I can prevent this from happening?
-
Dec 1, 2009, 00:17 #2
- Join Date
- Sep 2005
- Location
- Durham, NC
- Posts
- 1,659
- Mentioned
- 5 Post(s)
- Tagged
- 0 Thread(s)
I am assuming you are using php with the database. It may be using htmlspecialchars on the field in the code before adding to your database. This will save you headaches later. If you really want <,> to appear check your code to see if that function is used.
-
Dec 1, 2009, 01:57 #3
Yes I am. And thanks for the suggestion Ryan B.
I think it was the textarea that was replacing the characters, but not exactly sure. What I ended up doing, if you're curious, is replaced the < > with unique character strings and converted them back with a javascript variable. I'm using javascript to display table records along with an editing form - I'm not going out of my way to use js for this.
Anyway, thanks again, and have a good one.
-
Dec 1, 2009, 03:03 #4
Server side, you could use http://www.php.net/manual/en/functio...ars-decode.php
Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget
Bookmarks