形式:
<form name="edit" method="post" action="add_comment">
<table width="100%" border="0" cellpadding="4" cellspacing="8" id="editor_table"><tbody>
...
<?php echo $_REQUEST[$saveStatus]; ?> /
<?php echo $_POST[$saveStatus]; ?> /
<?php echo $saveStatus; ?> / Mine unsuccefull try's
...
</tbody></table>
</form>
POST动作:
if ($username != null && $content != null) {
...
$saveStatus = '<span id="saveStatus" class="upload_success">сохранен</span>';
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
} else
if ($username == null || $content == null || $username == null && $content == null) {
$saveStatus = '<span id="saveStatus" class="upload_error">ошибка при сохранении</span>';
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
}
我正在尝试提交表单,然后它会将我引回到带有动态$ saveStatus变量的表单页面,但没有运气。