I am brand new to PHP and have run into an issue with my buttons in a table. When the button is clicked, it needs to get an ID number that is pulled from a database. I have no trouble getting the data and passing it to the next page using...
<form action="ThisPage.php" method="post">
<td><input name="Submit" type="submit" value=<?php echo $OrderNumber; ?> ></td>
</form>
Everything works perfectly, except that the $OrderNumber variable shows up on the button itself. I would like the button to display as "Edit", not the $OrderNumber variable that is showing in the attached image.
How could I make the button say "Edit", but apply a posted value of the $OrderNumber value? I have been unable to find a way to accomplish the passing of correct and unique data while also displaying a button that does not confuse the end user.
To get to the next page, I am checking for a posted value at the beginning of the PHP script. If there is a posted value, in this case, $OrderNumber, then the script carries the variables to the next page as shown...
<?php
if(!empty ($_POST['Submit']) )
{
$_SESSION['OrderID']=$_POST['Submit'];
header("location:NextPage.php");
exit;
}
?>
But if there is no posted data, the page runs and shows the rows representing the array of database entries. All is well except for this button label.