How can i post variable values from inside HTML form which is inside PHP loop.
A snippet of code I've written so far is below:
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;
}
While in '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);
?>
The output of buffer.php is
Array ( [roll] => hammad.hassan )
Array ( [addasmnt] => Add Assesment )
Array ( )
Array ( [addasmnt] => Add Assesment )
The $_POST is not showing any variables.
$_POSTis empty?