Re: Retrieving special characters



"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)


.



Relevant Pages

  • Re: ruby html (or xhtml) forms class...
    ... xx is a library designed to extend ruby objects with html, xhtml, and xml ... xml or xhtml as clean looking and natural as ruby it self. ... attributes may be passed to any tag method as either symbol or string. ...
    (comp.lang.ruby)
  • Re: CSS Safari Problem (Mac)
    ... indirectly quoted, ... anything to say on my point: mixing HTML 4.01 and XHTML 1.0 is clueless. ... The closed meta tag was copied and pasted from Google's Webmaster ... But since this is Usenet, many likely are aware that the theme song ...
    (alt.html)
  • Re: Dynamically assigning functions with parameters to events
    ... which in turn does the work at mouseover-time: ... `onmouseover' is an attribute of the `body' element in Valid HTML ... its start tag. ... That it works in a handful of ...
    (comp.lang.javascript)
  • wierd behavior in program
    ... I am reading a file with html tags in ... I read each tag and push it on the stack and pop it when I ... int degree; ...
    (comp.lang.c)
  • Re: Please test my college project website
    ... at least get you started with the basic HTML and CSS. ... Validator message export for "http://www.groupmessage.co.uk": ... can add this from the Tags menu and/or from the Tag Inserter. ... browsers, ...
    (alt.html)