Jump to content

howardmoore

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by howardmoore

  1. Hi, I am building a site using PHP includes to show a set bit of content on lots of pages (i.e. some standard repeating text). The problem is that when I call the include, all the data shown below where it appears is the same as the include, and not the main page that I am trying to call. Both the include and the page on which is sits need to call a field from a MySQL database called 'content'. Can anyone think of a workaround for this? Many thanks, Neil
  2. 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
  3. Thanks. I get the following: Fatal error: Call to undefined function: htmlspecialchars_decode() in ...
  4. When using utf8_decode I get: <p><span style="color: #0000ff">Coloured Blue</span></p> <p><span style="color: #00ff00">Coloured Green</span></p> When using htmlspecialchars_decode() I get nothing at all. The page just stops at the point where it is meant to display, meaning that the rest of the page template failes to display too.
  5. Thanks - I did see this in some of the searches I did, but I cannot work out where this will fit into my code. I have tried replacing utf8_decode with htmlspecialchars_decode, but this just returns no results at all. Thanks, Neil
  6. Hi, I am a very new to HTML, so please go easy on the explanations. I have tried searching the forum but unfortunately I didn't understanding much of what I read. I have a PHP script that writes to a MySQL database. One particular row ('description') uses HTML, as I use fckeditor to create the content. fckeditor and the form I wrote posts the content to the database just fine using: $description=htmlspecialchars($description,ENT_QUOTES); When I browse the row using phpMyadmin the htmlspecialchars has worked perfectly. However, the problem I have is when I am trying to show the contents of 'description' on a webpage. I use the following: <?php $sql = "SELECT * FROM `jmnpevents` WHERE startDate between '".date("Y-m-d")."' AND '".date("Y-m-d",mktime(0, 0, 0, date("m"), date("d")+$daysAhead, date("Y")))."' ORDER BY startDate ASC"; $sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql); while ($row = mysql_fetch_assoc($sql_result)) { if ($row["description"]<>'') { echo '<table class="calendar_list"><tr><td class="calendar_list_date">'; echo date("F j, Y",strtotime($row["startDate"])).' - <strong>'; echo nl2br(stripslashes(utf8_decode($row["name"]))).'</strong></td></tr>'; echo '<tr><td class="calendar_list_description">'; echo stripslashes(utf8_decode($row["description"])).'</td></tr></table><br /><br />'; }; }; ?> However, this only shows the content as HTML tags, rather then rendering it properly as HTML. Does anyone know what I can do to solve this problem. I presume that it is something to do with the decoding, but for the life of me the searches I have done have not shed any light. Thanks in advance. Neil
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.