I have a form to modify a record in a MySQL database.
The record contains this:
3" Brush
The code in question is like this:
while ($row = mysql_fetch_array($result)) {
$desc1 = $row['desc1'];
--
">
I've tried using addslashes to the variable in various ways and it
always returns:
3\
This seems to be more of a HTML problem.
Form fields simply canĀ“t print out ". You need to change the " to " in
order for it to appear.
This can be done using the function htmlspecialchars():
http://www.php.net/manual/en/function.htmlspecialchars.php
In your case:
">
You can test these two thing
Jeff, here's what I do:
1. set magic_quotes_gpc On in php.ini
* this will automatically quote all GET, POST, and COOKIE
variables - read up on magic_quotes_gpc.
2. at the top of each script, stripslashes all the COOKIE, GET,
and POST variables, since they will have been
3 matches
Mail list logo