#32230 [Bgs]: single quotes
ID: 32230
Updated by: johannes@php.net
Reported By: amal_omairi at yahoo dot com
Status: Bogus
Bug Type: Output Control
Operating System: Windows XP Pro
PHP Version: 4.3.10
New Comment:
> what do you advice me to do? thank you again:-)
To ask support questions not in the bug database
But in support forums http://www.php.net/support.php
Previous Comments:
------------------------------------------------------------------------
[2005-03-08 16:25:52] amal_omairi at yahoo dot com
thank you for repling. actually addslashes and strip slashes are used.
you say it is not a php error so do you think the use of
html_entity_decode() nor htmlspecialchars()? what do you advice me to
do? thank you again:-)
------------------------------------------------------------------------
[2005-03-08 10:43:54] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Even if you think it is not a bug, we often know better than you,
please consult the support channels first before even considering
to reopen this report.
Thank you for your interest in PHP.
.
------------------------------------------------------------------------
[2005-03-08 09:06:05] amal_omairi at yahoo dot com
Description:
------------
i work on a content management area system. where user text inserted to
a table in MySQL database and then reteived for preview in atext area.
but when user types a single quote it is previewed as double quotes.
the magic_quotes_gpc is on, and magic_quotes_sybase is off. addslashes
is not used but stripslashes is used when retrieval from databse.
please help.
Reproduce code:
---------------
<?
include ("../../conn.php");
include ("../../db.php");
$table_name = "menu2_1";
if (isset($mode))
if (strstr($mode,"prev") != "")
$table_name .= "_prev";
$query = "select * from ".$table_name;
$result = mysql_query($query);
$num = mysql_num_rows($result);
$row = mysql_fetch_row($result);
if(!$num)
{
$query = "insert into ".$table_name." (content) values
('')";
$result = mysql_query($query);
}
?>
....
<TD nowrap valign=top><TEXTAREA name="article" rows="5"
class=textarea1><?=stripslashes($row[0])?></TEXTAREA></TD>
Expected result:
----------------
preview single quote.
Actual result:
--------------
previwes double qoutes instead.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32230&edit=1
Thread (4 messages)