POST Form not working - $_POST receiving variable name as the value
Posted 18 August 2006 - 01:56 AM
form method="POST" page code:
<form action="orderupdate.php" enctype='multipart/form-data' method="POST">
<input type="hidden" name="order_id" value=$ordid>
<input type="hidden" name="email_addr" value=$email>
<input type="hidden" name="order_status" value=$statPublic>
<p align="center"><input name="Update Order" type="submit" value="Update Order" align="middle"></p>
<?$order_id = $_POST['order_id'];?>
<?$email_addr = $_POST['email_addr'];?>
<?$order_status = $_POST['order_status'];?>
The printf statements display the values: "$ordid $email $statPublic" rather than the actual values of the fields. If I add a printf statement to the "POSTing" form after the inputs, the value shows correctly (e.g. email_addr = email@example.com. If I change the input tag from type='hidden' to type='text' and enter a value, the value POSTs and displays correctly on the updateorder.php page. So I know the POST is working. It seems that the type='hidden' is my problem?
I did get the transfer of the variable values to work with the GET method, but I don't want the values to be part of the URL. I prefer to get the POST method to work.
???Thank you for your help.
Posted 18 August 2006 - 01:13 PM
Posted 18 August 2006 - 03:06 PM
I had fooled around with this problem for 6 hours reading and trying options before posting my question here. With your help, it was solved in a minute.
In reading my Programming PHP book to understand why the ?echo was required I now see that the echo() command puts the string from the PHP generated page into the HTML. I have a lot more learning to do.
Thank you for teaching me something!
Posted 18 August 2006 - 03:24 PM
echo "<input type=...
Anything shown to the users machine needs to be in an echo (or print or simular functions)
if its not in an echo, its not read out
Posted 18 August 2006 - 04:04 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users