You are here: Re: Retrieving special characters « PHP Programming Language « IT news, forums, messages
Re: Retrieving special characters

Posted by Jerry Stuckle on 03/29/06 13:45

Larry wrote:
> 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@nospam.com>
> 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?
>
> Many thanks,
> Larry L

Larry,

Single quotes are also used as a delimiter in SQL. But are you sure that's your
problem? If you had mismatched quotes, I would expect you to get an error when
you try to insert it into the database.

Chances are the problem is in the display of the data. First of all, do you see
it if you look at the page source in your browser? If the data is there, it's
only a matter of handling the special characters - check out htmlentities().

If the data is not there, you need to look at your code to see what happened.

And BTW - your method is *very* insecure. It will easily turn your site into a
spammers paradise. All one has to do is submit a form with another email
address in the hidden field. Rather, save the primary key in the hidden field
and retrieve the email address from the database when you send the email.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация