Jump to content

displaying variables in html form


ldoozer

Recommended Posts

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>';
} 
?>

Link to comment
https://forums.phpfreaks.com/topic/72174-displaying-variables-in-html-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.