UPDATE table using FCKeditor
<form action="data_arch.php" method="post" target="_blank">
<?php
$oFCKeditor = new FCKeditor('arche');
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = 'Въведете текста си тук';
$oFCKeditor->Create();
?>
<br />
<input type="submit" value="Submit">
</form><?php
if ( isset( $_POST ) )
$postArray = &$_POST ;
else
$postArray = &$HTTP_POST_VARS ;
foreach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = stripslashes( $value );
else
$postedValue = $value;
}
mysql_connect("localhost", $user, $pass) or die(mysql_error());
mysql_select_db("garmen_arche") or die(mysql_error());
mysql_query("INSERT INTO statii(htmlCode, data) VALUES('$postedValue', CURDATE())") or die(mysql_error());
echo "<br />";
echo $postedValue;
?>
<?php
//write
mysql_connect("localhost", $user, $pass) or die(mysql_error());
mysql_select_db("garmen_arche") or die(mysql_error());
mysql_query("INSERT INTO accdate (curdata) VALUES(CURDATE())") or die(mysql_error());
?>
<form action="edit_arche.php" method="post">
<?php
mysql_connect("localhost", $user, $pass) or
die(mysql_error());
mysql_select_db("garmen_arche") or die(mysql_error());
if($_GET["cmd"] == "edit" || $_POST["cmd"] == "edit")
{
if (!isset($_POST["submit"]))
{
$ID = $_GET["rowID"];
$result = mysql_query("SELECT * FROM statii WHERE ID=$ID") or
die(mysql_error());
$row = mysql_fetch_array($result);
$rowhtmlCode = $row['htmlCode'];
$oFCKeditor = new FCKeditor('edit_arche');
$oFCKeditor->BasePath = '/fckeditor/';
$oFCKeditor->Value = $rowhtmlCode ;
$oFCKeditor->Create();
?>
<br />
<input type="hidden" value="Submit">
<input type="submit" name="submit" value="Submit">
</form>
<?php
echo $sForm;
echo $value;
}
?>
<?php
if ($_POST)
$postArray = $_POST['edit_arche'] ;
else
$postArray = $HTTP_POST_VARS ;
foreach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = stripslashes( $value );
else
$postedValue = $value;
}
echo $postedValue;
echo "<br />";
echo $sForm;
echo "<br />";
echo $value;
mysql_connect("localhost", $user, $pass) or
die(mysql_error());
mysql_select_db("garmen_arche") or die(mysql_error());
mysql_query("UPDATE statii SET htmlCode='$postedValue' WHERE id='$ID'") or
die(mysql_error());
}
?>
Re: UPDATE table using FCKeditor
Re: UPDATE table using FCKeditor