hey all,
new to all this here php stuff but i've got a nagging problem getting plain 'ol HTML out of fckeditor ...
here's some code which is the action of an FCK form->
---------------------------------
<?php session_start(); $username = $_SESSION['username']; if ( isset( $_POST ) ) $postArray = &$_POST ; else $postArray = &$HTTP_POST_VARS ; foreach ( $postArray as $sForm => $value ) { $postedValue = htmlspecialchars( stripslashes( $value ) ) ; } $position = "content"; (other sql stuff) $content = $postedValue; $Link = mysql_connect ($Host, $User, $Password); $Query = "UPDATE " . $TableName . " SET " . $position . " = '" .$content . "' WHERE username = '" . $username . "'"; if (mysql_db_query ($DBName, $Query, $Link)) { header ("location: ../../../show_page_make.php"); } else { print ("$username , $content"); } mysql_close ($Link); ?>
----------------------------------
which DOES work ....
but the database entry then contains this --->
-----------------------------------
<p><font color="#ff0000">hel...
-----------------------------------
etc...
which i assume is some sort of nifty xml stuff BECAUSE... when i use it in a generated html (php) page (as a string brought in from the database)
-----------------------------------------
<div align="center"> $Row[content] </div>
-----------------------------------------
i get the HTML code itself displayed in the browser window. (the code created by FCK is correct just not being sent as a straight string variable.
(phew....)
obviously i am missing something in the translation here .... but after spending about 4 days google'ing and searching for an answer.... i've found none.
any help would be greatly appreciated.
thanks in advance,
jeff
RE: html output from fckeditor - help please
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
it should be:
postedValue = stripslashes( $value ) ;