This is what i'm trying to do, I have a form in one page:
<form action="update.php" method="post" value="">
<textarea name="update">
<?php $page_name = "home"; $tablename = "pages"; $columnname = "content"; $redirect="formulier_home.php"; ?>
<?php $result = mysql_query("SELECT $columnname FROM $tablename WHERE page_name = '$page_name'"); ?>
<?php include("../includes/content_in_textarea.php"); ?>
</textarea>
<input type="submit" value="Publiceer" >
</form>
and I update in another page:
<?php require_once("../includes/connection.php"); ?>
<?php $opvangen = $_POST['update'];?>
<?php $content = nl2br($opvangen); ?>
<?php mysql_query("UPDATE $tablename SET $columnname='$content' WHERE page_name='$page_name'") or die (mysql_error());
header("Location:$redirect"); ?>
It works fine if I don't use variables in the query like this:
<?php mysql_query("UPDATE $tablename SET $columnname='$content' WHERE page_name='$page_name'")or die (mysql_error());
header("Location:$redirect"); ?>
But I'm a little confused on how I will transfer the variables to the update page, I want to use the update page for all my columns and pages that I want to adjust.