嗨,有人可以告诉我这段代码有什么问题吗?看起来不错,但它不起作用;单击按钮后,它应该通过帖子启动回声。
所以编辑了一些代码,现在看起来像:
<?php
error_reporting(E_ALL);
echo "<form class='upload' method='post' enctype='multipart/form-data' action='$_SERVER[PHP_SELF]?low=1'>
<input type='hidden' name='upload' value='go1' />
<input type='submit' value='low' />
</form>
<form class='upload' method='post' enctype='multipart/form-data' action='$_SERVER[PHP_SELF]?high=1'>
<input type='hidden' name='upload' value='go2' />
<input type='submit' value='high' />";
if ( $_POST['upload'] == 'go1' ) {
if ( $_POST['low'] == '1' ) { echo 'low1'; }
};
if ( $_POST['upload'] == 'go2' ) {
if ( $_POST['high'] == '1' ) { echo 'high1'; }
};
?>
但仍然出现错误:
[20-Jul-2013 02:00:11 Europe/Warsaw] PHP Notice: Undefined index: upload in /home/file.php on line 12
[20-Jul-2013 02:00:11 Europe/Warsaw] PHP Notice: Undefined index: upload in /home/file.php line 16
[20-Jul-2013 02:00:12 Europe/Warsaw] PHP Notice: Undefined index: low in /home/file.php on line 13