<?php
include('config.php');
if(!isset($_SESSION['gebruiker']))
{
header("Location: index.php");
}
$query="SELECT * FROM table1 WHERE id='" .$_GET["id"]."'";
$result = mysql_query($query) or die ("Error1: " . mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
include_once("fckeditor/fckeditor.php") ;
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >
<link href="adminsystem.css" rel="stylesheet" type="text/css" >
</head>
<body>
<?php
// Getting information and assigning it to temporary variable
while ($rij = mysql_fetch_array($result)){
$name = $row['name'];
$guide = $row['guide'] ;
}
?>
<FORM ACTION="<?php echo($_SERVER["PHP_SELF"]);?>" METHOD="post">
Name:
<br><INPUT TYPE="text" NAME="naam" SIZE=30 MAXLENGTH=120 value="<?php echo($name);?>"> <br>
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/fckeditor/' ;
$oFCKeditor->Width = '100%';
$oFCKeditor->Height = '500';
$oFCKeditor->Value = $guide ;
$oFCKeditor->Create() ;
$sValue = stripslashes( $_POST['FCKeditor1'] ) ;
?>
<input type="hidden" name="Confirm" value="1">
<input type="hidden" name="id" value="<?php echo($_GET["id"]);?>">
<INPUT TYPE="Submit" VALUE="Change">
<input type="Button" value="Back" onclick="javascript:history.back();">
</form>
<?php
if (isset($_POST["Confirm"]))
{
$query = "UPDATE table1 SET name='$_POST[name]', guide='$_POST[FCKeditor1]' WHERE id = '".$_POST["id"]."'";
mysql_query($query) or die ("Error2: " . mysql_error());
header("Location: index.php");
}
else
{
}
?>
</body>
</html>
Sun, 07/18/2010 - 23:23
#1

Re: Can't update database
Re: Can't update database