Slashes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all,

i need help on my slashes.. i saw php.net say:

"Do not use addslashes() on strings that have already been escaped with magic_quotes_gpc as you'll then do double escaping."

with that, i also did not do a stripslashes when i retrieve my data, since my magic_quotes_gpc is on.. but why is it that I still get a backslash before an occurrence of a single-quote? 

for example,
<td width="630" height="6"><? echo $fieldName; ?></td>

where $fieldName is retrieved from the database through:

$query = "select fieldName from table where condition ";

$result = mysql_query($query);
      
$fieldName = mysql_result($result,0);  // which is James' Favourite Pet

also, a more serious problem is when i echo the $fieldName into a textbox.

for example:
<input type="text" name="field1" size="20" value="<? echo $fieldName; ?>">

if $fieldName contains: it's name is "Bob", 
anything after the double quote (i.e. Bob") gets cut-off! it's disaster!!

dear php developers, can you please enlighten me on what happened? and how can I rectify the problem? thanx so much!

regards,
hwee

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux