|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-08 10:43 UTC] derick@php.net
[2005-03-08 16:25 UTC] amal_omairi at yahoo dot com
[2005-03-08 16:33 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
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.