php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32230 single quotes
Submitted: 2005-03-08 09:06 UTC Modified: 2005-03-08 16:33 UTC
From: amal_omairi at yahoo dot com Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.10 OS: Windows XP Pro
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: amal_omairi at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-03-08 09:06 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-08 10:43 UTC] 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 16:25 UTC] 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 16:33 UTC] johannes@php.net
> 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 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 04:01:29 2025 UTC