Integrating FCKeditor form with mysql
<?php
include("fckeditor/fckeditor.php") ;
?>
<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link href="../sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>FCKeditor - PHP - Sample 1</h1>
This sample displays a normal HTML form with an FCKeditor with full features
enabled.
<hr>
<form action="insert.php" method="post" target="_blank">
Point of Interest:<br />
<input type="text" size="75" name="title" />
<br />
<br />
Travel Blog:<br />
<?php
$oFCKeditor = new FCKeditor("blog") ;
$oFCKeditor->BasePath = '../fckeditor/' ;
$oFCKeditor->Value = 'This is some <strong>sample text</strong>. You are using <a href="<a href="http://www.fckeditor.net/" target="_blank">http://www.fckeditor.net/</a>">FCKeditor</a>.' ;
$oFCKeditor->Create() ;
?>
<br>
Associated Link:<br />
<input type="text" size="75" name="link" />
<br />
<br />
<input type="submit" value="Submit" >
</form>
</body>
</html>
I would like the FCKeditor to be visible for the "Travel Blog" only in this form and currently it won't appear. I believe this to be caused by my poor understanding
of how to modify the "sampleposteddata.php" script and my own "insert.php" script below (which saves the form entries to a mysql database):
<?php
$con = mysql_connect("127.0.0.1","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("tm", $con);
$sql="INSERT INTO poi (title, date, blog, link)
VALUES
('$_POST[title]','$_POST[date]','$_POST[blog]','$_POST[link]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>