Re: Retrieving special characters
- From: "Kimmo Laine" <spam@xxxxxxxxxxxxx>
- Date: Wed, 29 Mar 2006 10:02:16 +0300
"Larry" <noway@xxxxxxxx> wrote in message
news:tynWf.16641$w86.1083@xxxxxxxxxxxxxxxxxxxxxxx
OK, I've been searching around the net for numerous hours and seem to just
be
getting more confused about handling special characters.
In my host's configuration MagicQuotes is ON. (I understand this is
considered
a bad thing by many)
A user submitted an email in the form 'Bob Smith' <bob@xxxxxxxxxx>
Now when I look in the MySql database (via PhpMyAdmin) it's exactly that,
but
when I try to retrieve it with a standard query, it echo's or prints as
Bob
Smith. I have the same problem with a store name containing a single
apostrophe. Obviously the single quote is stopping it, but how do I get
past
that?
In HTML <bob@xxxxxxxxxx> will be concidered as a tag, nonsense tag since
it's not really a tag but the <> make html think it is, therefor it's
hidden. To fix it, special chars need to be converted to format where html
does not concider them as control characters such as tag delimiters. There
is a function that does this conversion called htmlspecialchars.
Try something like:
echo htmlspecialchars("'Bob Smith' <bob@xxxxxxxxxx>");
http://php.net/htmlspecialchars
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@xxxxxxxxxxxxx | Gedoon-S @ IRCnet | rot13(xvzzb@xxxxxxxxxxxxx)
.
- Follow-Ups:
- Re: Retrieving special characters
- From: Larry
- Re: Retrieving special characters
- References:
- Retrieving special characters
- From: Larry
- Retrieving special characters
- Prev by Date: Re: can you redirect every existing html page through a php function?
- Next by Date: How to create a dynamic link in a RTF document
- Previous by thread: Re: Retrieving special characters
- Next by thread: Re: Retrieving special characters
- Index(es):
Relevant Pages
|
|