0
如何发布PHP循环内的HTML表单中的变量值?从PHP内部的HTML表单中发布变量值循环
我到目前为止已经编写的代码片段低于:
while($row=oci_fetch_array($sql))
{
echo "
<body>
<fieldset style=\" box-shadow: 1px 1px 10px 1px #C4C4C4;
border:0;
width:420px;
height:125px;\">
<form action=\"buffer.php\" method=\"POST\">
<strong>Code:</strong> <input type=\" text\" value=\" $row[0]\" name=\" code\" disabled ><br>
<strong>Course Name:</strong> <input type=\" text\" value=\" $row[1]\" name=\" namec\" disabled><br>
<strong>Credit:</strong> <input type=\" text\" value=\" $row[2]\" name=\" credit\" disabled ><br>
<strong>Section:</strong> <input type=\" text\" value=\" $row[3]\" name=\" section\"disabled ><br>
<input type=\"submit\" value=\"Add Assesment \" name=\"addasmnt\"><input type=\"submit\" value=\"Edit Attendance \" name=\"editasgmnt\">
</br> </fieldset> </form> </body>
";
$i=$i+1;
}
而在 'buffer.php';
<?php
session_start();
$roll= $_SESSION['roll'];
print_r($_SESSION);echo "<br>";
print_r($_POST);echo "<br>";
print_r($_GET);echo "<br>";
print_r($_REQUEST);
?>
buffer.php的输出是
Array ([roll] => hammad.hassan)
Array ([addasmnt] => Add Assesment)
Array ()
Array ([addasmnt] => Add Assesment)
$_POST
的未示出的任何变量。
你是说你提交后'$ _POST'是空的吗? – Rasclatt