Hi,
PHP will only do this sort of translation if it is made to do so.
Here are the parts of the language that are likely to relate to your
problem:
- The magic_quotes_gpc configuration directive
- The addslashes() function
- The htmlentities() or htmlspecialchars() function
Now, while you don't need to escape the HTML entities before you insert your
data into the database, you will still need to add slashes to the data.
The slashes are used to escape special characters (like " and ') that are
likely to prevent a string from being inserted into the database.
When you retrieve that slash escaped data from the database, you can remove
them using stripslashes().
--zak
----- Original Message -----
From: "Michele Santucci" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 12:20 AM
Subject: PHP & MySQL
I have a stupid problem with PHP & MySQL (I'm a newbie of course):
I push in a text/blob record a string like this:
<img src="foo.gif" border="0">
when I read & print this record with PHP (using a simple echo statement ) I
got back the string translated in this way:
<IMG SRC=\"foo.gif\" border=\"0\">
How can I prevent PHP from doing this translation and giving me back just
what I wrote inside the field?
bye by{t}e[s].... TuX!
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php