howardmoore Posted May 20, 2009 Share Posted May 20, 2009 I am using a bespoke update script to edit page content using PHP and MySQL. The way that the script works is to look at a table, bring up the 'content' row in a textarea and give you the ability to edit it. To add a little more functionality I have set fckeditor to edit the text area. What is happening is that when I go to edit the content in the textarea, it already has back-slashes before the quotation marks (as it has been properly input using PHP and MySQL). However the fckeditor cannot seem to process this. To give you an example, the following simply content may appear: <p><span style=\"color: #ff0000\">RED</span></p> However, fckeditor sees this as: <p><span style=""color: ">RED</span></p> I have no idea what I am doing wrong to get this, but is there a way to return the code to the text area already cleaned so that it shows as: <p><span style="color: #ff00000">RED</span></p> The following is the code that brings up the textarea results (where 'content' is the textarea that is editable using fckeditor): if ($eid) { $menu=1;$result=mysql_query("SELECT * FROM JCRA2 WHERE id='$eid'",$db);$myrow=mysql_fetch_array($result);?> <form name="form1" method="post" action="<?php echo $fileName ?>"><div align="center"> <table width="600" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#EBEEF1"> <tr class=largeform> <td width="100" align="right">Page Code:</td> <td width="278" align="left"><input type="hidden" name="code" id="code" value="<?php echo $myrow[code] ?>"><?php echo $myrow[code] ?></td> </tr> <tr class=largeform> <td align="right">Title:</td> <td align="left"><input type="text" name="title" size="40" id="title" value="<?php echo $myrow[title] ?>"></td> </tr> <tr class=largeform> <td align="right">Content:</td> <td align="left"><textarea name="content" cols="50" rows="15" id="content"><?php echo ($myrow[content]) ?></textarea></td> </tr> <tr class=largeform> <td align="right">Keywords:</td> <td align="left"><textarea name="keywords" cols="50" rows="2" id="keywords"><?php echo $myrow[keywords] ?></textarea></td> </tr> <tr class=largeform> <td align="right">Description:</td> <td align="left"><textarea name="description" cols="50" rows="2" id="description"><?php echo $myrow[description] ?></textarea></td> </tr> <tr class=largeform> <td align="right">Last Update:</td> <td align="left"><?php print(date("d-m-Y")); ?><input type="hidden" name="last_update" id="last_update" value="<?php print(date("Y-m-d")); ?>"></td> </tr> <tr align="center" class=largeform> <td colspan="2"><input type="submit" name="Submit" value="Change Page"> <input type="button" name="Button" value="Cancel Changes" onClick="location='<?php echo $fileName ?>'"><input name="id" type="hidden" id="id" value="<?php echo $myrow[id] ?>"></td> </tr> </table> </form> Really appreciate any help on this, as I am rather stuck on this one, and it is the last hurdle to complete before my project is finished!! Thanks, Neil Link to comment https://forums.phpfreaks.com/topic/158994-cannot-get-html-text-to-display-correctly-in-mysql-results/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.