i cant understand why the updatepost function isnt working when i print the query n_title and n_desc are blank.
<?
// Status Msg
function updatepost() {
$query_edit="UPDATE Dowdales SET
n_desc = '$editor1',
n_title = '$n_title' WHERE nid = '$id'";
mysql_query($query_edit) or die(mysql_error().'There has been a problem while trying to edit the news , please contact the administrator');
echo "Success the news post has been updated!";
print $query_edit;
}
function pagestatus() {
echo "Ready";
}
$func = $do_what;
if ('' == $func) {
$func = pagestatus; // Assume pagestatus if do_what is null
}
$func($n_title,$editor1,$id,$news_table,$pg_nm,$nid);
?>
and the form:
<form action="index.php" method="post" target="_self">
<tr>
<td width="99">News Title</td>
<td width="664"><div align="left">
<input name="n_title" type="text" id="n_title" value="<? echo "$title_data"; ?>">
</div></td>
</tr>
<tr>
<td>News Content </td>
<td><div align="left">
<input name="editor1" type="text" id="editor1" value="<? echo "$editor_data"; ?>">
</div></td>
</tr>
<tr>
<td>Submit</td>
<td><div align="left">
<input type="hidden" name="id" value="<? echo $id; ?>">
<input type="hidden" name="do_what" value="updatepost">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</form>