从POST获取变量?

时间:2017-04-08 15:31:40

标签: php variables post

形式:

<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变量的表单页面,但没有运气。

0 个答案:

没有答案