Hi,
When my form action points to sampleposteddata.php (downloaded with program), I can include images in the text and see the HTML code. But when I send the data to mysql, it does not want to insert to the table. The funny thing is that without images (only text) sending data to Mysql works fine...but as soon as I remove the image, I can upload the data into mysql without hassles...with an image in the text I cannot upload to mysql. I can see the images in the editor but not in my database.
Here is my code:
<?php include("fckeditor/fckeditor.php") ;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Aktuell Admin</title>
</head>
<body>
<?php $self = $_SERVER['PHP_SELF'];
$art_id= $_POST['art_id'];
$art_title= $_POST['art_title'];
$art_author_id= $_POST['art_author_id'];
$art_publishing_date= $_POST['art_publishing_date'];
$art_body= stripslashes( $_POST['oFCKeditor'] ) ;
$art_update= $_POST['art_update'];
$published= $_POST['published'];?>
<form action="<?php echo ($self);?>" method="POST" name="form1" target="_parent">
Add New Topic
<label>ID : </label><input name="art_id" type="text" />
<p><label>Title</label><input name="art_title" type="text" /></p>
<p><label>Author</label><input name="art_author_id" type="text" /></p>
<p><input name="art_publishing_date" type="hidden" value="<?php echo date("Y-m-d");?>" /></p>
<p><fieldset><legend>Article Body</legend></fieldset><?php
$oFCKeditor = new FCKeditor('oFCKeditor') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$oFCKeditor->Create() ;
?>
<p><label>Publish New Article? </label><label>No</label><input name="published" type="radio" value="No" /><label>Yes</label><input name="published" type="radio" value="Yes" />
<p><input name="art_update" type="hidden" value="<?php echo date("Y-m-d");?>" /></p>
<br>
<input type="submit" value="Submit">
</form>
<?php
if($art_id and $art_title and $art_author_id and $art_body and $art_publishing_date and $published and $art_update) //ensure values exist
{//connect to mysql
//create the query
$sql="insert into articles (art_id, art_title, art_author_id, art_publishing_date, art_body, art_update, published)
values ($art_id, \"$art_title\", \"$art_author_id\", \"$art_publishing_date\", \"$art_body\", \"$art_update\", \"$published\")";
//execute the query
$rs=mysql_query($sql, $labortechnik);
//confirm the added record details
if($rs){ echo("Record added : $art_title");}
}
?>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Please help or point me in the right direction.
DotKhoza
Thu, 01/08/2009 - 14:21
#1