Re: query problem.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, January 25, 2006 7:01 am, Angelo Zanetti wrote:
> The data in that field is: Sams Bank <sam@xxxxxxxxxx>
.
.
.
> Why does the < > cause that not to be displayed? or is it retrieving
> it
> correctly but not showing it because of the < > (which might be
> conflicting with HTML tags?

You have hit the nail on the head here.

If you use your browser's "View Source" menu, you'll see the full value.

NOTE: "View Source" is ALWAYS a good idea when what you see is not
what you expect.

If you want to display that data as HTML data, you would use:
http://php.net/htmlentities
which will translate the special characters into HTML entities, which
will render correctly in browsers.

You should use htmlentities right before you spit out the data, and be
very careful not to confuse the data that has had htmlentities applied
with the original.

So, you might do:

$email = ... /* get mysql result here, somehow */
$email_html = htmlentiites($email);
echo "Email: $email_html<br />\n";

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux