So, now, in my site administrator section, I allow the site owner to update pages, and resubmit the html code back for storage in the db column. The new problem...when the information is submitted back, it looks like PHP is adding escape \\'s each time the submit is made, and it is really wacking things out when the html is presented each new time (after an update has been submitted) in the browser . Is there some basic command I am missing? Thanks! Here is the submit code and the form code.
SUBMITTED HTML CODE:
This is my code<BR><BR>
This is my page<BR><BR>
<i>You know nothing<i><BR><BR>
<IMG SRC="site_img1.gif" WIDTH="100" HEIGHT="100" BORDER="0">
BECOMES:
This is my code<BR><BR>
This is my page<BR><BR>
<i>You know nothing<i><BR><BR>
<IMG SRC=\\"site_img1.gif\\" WIDTH=\\"100\\" HEIGHT=\\"100\\" BORDER=\\"0\\">
FORM CODE
<?
// include function files for this application
require_once("sc_fns.php");
$POST['html_page_name'] = addslashes($POST['html_page_name']);
admin_header();
echo "<BR><FONT FACE='ARIAL, HELVETICA' SIZE='2' COLOR='333366'>To update your html page content, change the information below and click submit. <BR>Your html code information will be updated in your cart database<BR>";
db_connct();
mysql_select_db("book_sc");
$query = ("SELECT * FROM html_pages WHERE html_page_name = '$html_page_name'");
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
// echo "<BR>Number of html pages found:".$num_results."";
// This is just for testing purposes
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
}
?>
<FORM METHOD="POST" ACTION="update_html.php">
<TABLE COLS="2" BORDER="0" CELLPADDING="5" CELLSPACING="0">
<TR>
<TD WIDTH="150"><FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1" COLOR="000000">HTML Page Name:</FONT></TD>
<TD><INPUT TYPE="TEXT" NAME="html_page_name" VALUE="<?PHP echo $row["html_page_name"]; ?>"></TD>
</TR>
<TR>
<TD WIDTH="150"><FONT FACE="VERDANA, ARIAL, HELVETICA" SIZE="1" COLOR="000000">HTML Code:</FONT></TD>
<TD><textarea cols=40 rows=8 name=html_page_code><? echo $row["html_page_code"]; ?></textarea></TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH="749" COLS="2" BORDER="0" CELLPADDING="3" CELLSPACING="5">
<TR>
<TD WIDTH="375" ALIGN="RIGHT"><INPUT TYPE="IMAGE" SRC="images/admin/admin_submit_submit.gif" WIDTH="100" HEIGHT="23" BORDER="0" VALUE="SUBMIT"></TD>
<TD WIDTH="374" ALIGN="LEFT"><A HREF="login.php"><IMG SRC="images/admin/admin_submit_cancel.gif" WIDTH="100" HEIGHT="23" BORDER="0"></A></TD>
</TR>
</TABLE>
</FORM>
<?
do_html_footer();
?>