I have the following PHP Code
<form action="admin.php" method="post">
<?php
$conn=mysqli_connect("localhost","root","vravi","mrconnect");
if(!$conn)
{
echo "error establishing the connection";
}
$sql="select UserID,UserEmail from Users order by UserID";
$result=mysqli_query($conn,$sql);
if(mysqli_num_rows($result)>0)
{
while($row=mysqli_fetch_assoc($result))
{
echo $row["UserID"];
echo $row["UserEmail"]." ".'<input type=\"text\" name=\"name[]\"/>'."</br>";
}
echo '<button type=\"submit\" name=\"submit\" value=\"submit\">'.Submit.'</button></br>';
}
?>
</form>
which gives the following output in the browser.
Now I have two questions.
1)When I try insert some values in one of the textboxes and click submit button in the bottom, The values are not getting submitted.
below is my admin.php php file.
<?php
if(isset($_POST['submit']))
{
echo "submitted";
}
else
{
echo "not submitted";
}
?>
2)Now the second question is that, I also want my email id to get submitted through the form, but it is just a normal text, can anyone tell me how do we do that?