ldoozer Posted October 7, 2007 Share Posted October 7, 2007 Below i have a form which i want to be filled with variables sent from the last page. can anyone tell me why the variables are not showing - I think its something to do with the syntax of the php inside the html form <? if ($_POST['method']=='worldpay') { echo '<form action="#" method="post" name="BuyForm"> <input type="hidden" name="instId" value="120597"> <input type="hidden" name="cartId" value="GTG"> <input type="hidden" name="currency" value="GBP"> <input type="hidden" name="testMode" value="100"> <table border="0" cellpadding="0" cellspacing="3"> <tr> <td colspan="2"><h1><strong>Please confirm and click continue to payment</strong></h1></td> </tr> <tr> <td>Amount</td> <td><input name="amount" type="text" size="30" value="$_POST['amount']"></td> </tr> <tr> <td>Name</td> <td><input name="MC_Name" type="text" size="30" value="$_POST['MC_Name']"></td> </tr> <tr> <td>E Mail</td> <td><input name="MC_Email" type="text" size="30" value="$_POST['MC_Email']"></td> </tr> <tr> <td>Phone number </td> <td><input name="MC_Phone" type="text" size="30" value="$_POST['MC_Phone']"></td> </tr> </table> <!-- This generates a button that submits the information and sends the user to the Worldpay payment pages. --> <input type="submit" value="Buy Now" onclick="javascript:formCheck();"> </form>'; } else { echo '<tr><td align="center"><p>Please send cheques payable to ...</p></td></tr>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/ Share on other sites More sharing options...
~n[EO]n~ Posted October 7, 2007 Share Posted October 7, 2007 You have to save the variable name in SESSION in the first page. Have you done that ??? Quote Link to comment https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/#findComment-363934 Share on other sites More sharing options...
ldoozer Posted October 7, 2007 Author Share Posted October 7, 2007 no but before this if statement i have a bit if code which is collecting the variables by doing this - $message = "order: \r\n\r\nCustomer Name: ".$_POST['MC_Name']." and thats getting them ok??? Quote Link to comment https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/#findComment-363936 Share on other sites More sharing options...
MasterACE14 Posted October 7, 2007 Share Posted October 7, 2007 yep, that should be grabbing them fine. Quote Link to comment https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/#findComment-363937 Share on other sites More sharing options...
~n[EO]n~ Posted October 7, 2007 Share Posted October 7, 2007 $message = "order: \r\n\r\nCustomer Name: ".$_POST['MC_Name']." Without saving the $message variable in session, will it pass to the next page after form post ??? confused Quote Link to comment https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/#findComment-363947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.