Crew algemeen |
|
Kheb ff enkele dingen aangepast.
- eerste query+object verplaatst (regel 12+13 ==> 25+26)
- form action geset (regel 23)
- var buiten quotes (regel 35)
- $_POST['submit'] ==> $_SERVER['REQUEST_URI'] (regel 13)
- 2 maal error handling bij je queries (regel 17+25)
Probeer het nu eens.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Test</title>
<link href="../sample.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
include("../../fckeditor.php") ;
include("../../config.php");
$id = 1;
if($_SERVER['REQEUST_METHOD'] == "POST")
{
$test = htmlEntities($_POST['test'], ENT_QUOTES);
mysql_query(" UPDATE tekst SET tes='". $test ."', ' WHERE id='". $id ."'") or die(MySQL_Error));
echo "De gegevens zijn bewerkt.";
} else
{
?>
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<?php
$select = mysql_query(" SELECT * FROM tekst WHERE id='". $id ."'") or die(MySQL_Error());
$obj = mysql_fetch_object($select);
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = '/FCKeditor/' ; // '/FCKeditor/' is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) );
$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = $sBasePath;
$oFCKeditor->Value = $obj->test;
$oFCKeditor->Create();
?>
<br>
<input type="submit" value="Submit">
</form>
<?php
}
?>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Test</title> <link href="../sample.css" rel="stylesheet" type="text/css" /> </head> <body> <?php include("../../fckeditor.php") ; include("../../config.php"); $id = 1; if($_SERVER['REQEUST_METHOD'] == "POST") { echo "De gegevens zijn bewerkt."; } else { ?> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> <?php // Automatically calculates the editor base path based on the _samples directory. // This is usefull only for these samples. A real application should use something like this: // $oFCKeditor->BasePath = '/FCKeditor/' ; // '/FCKeditor/' is the default value. $sBasePath = $_SERVER['PHP_SELF'] ; $sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "_samples" ) ); $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value = $obj->test; $oFCKeditor->Create(); ?> <br> <input type="submit" value="Submit"> </form> <?php } ?> </body> </html>
|