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