Hello everyone,
I’m a bit of a newbie/intermediate at php and i’m trying to figure out $_Post, while using it on an e-commerce site. Nothing too advance, just a system that works with gateway processor. I’ve created the form and setup connections to the gateway. As of right now, the gateway processor is pre made and cannot customize their fields. However, there are two fields which anything can be pass into, ($email_header and $email_footer)
I’m sure someone knows how to do this.
I basically want to call one of the input fields that is entered on the form and pass that info into the header variable.
for example i tried using the birth field:
$birthdate = $_POST['birth'];
$email_header="Name: " . $birthdate . "<br>";
Nothing happens except when i receive the email confirm, i get: Name: br.
<?php
//Gateway connection information
$account="0000000000";
$service_type_code="000000000000";
$connecting_site_code="0000000000000";
//Transaction ID - for tracking on your end
$transaction_id="3435";
//Description of the Charge
$transaction_desc="Continuing Education Transaction";
//How much to charge the card
$charge_amount="0";
//Your CGI Script that receives the response from gateway processor
$post_back_url='http://www.post_back_url.php';
//Should customer receive a Credit Card Charge receipt via email?
$email_ind="TRUE";
//Should a person on staff that get copies of the Credit Card Charge receipt via email?
$merchant_email_ind="TRUE";
//Person on staff that gets copies of the Credit Card Charge receipt via email
$merchant_email="unknown@thisemail.com";
//Header of the Credit Card Charge receipt
$birthdate = $_POST['birth'];
$email_header="Name: " . $birthdate . "<br>";
//Footer of the Credit Card Charge receipt
$email_footer="Test Site";
//Variables to determine how the page displays
//CSS Setup
$FormFormat="horizontal2";
$HeaderHtmlPaymentForm= "<img src=http://img_src.gif width=697 height=154 alt=udeworld logo/> <h1>Payment Section</h1>";
$FooterHtmlPaymentForm="<p> Please be patient. If you click the submit button more than once, you will be charged again. <br /><br /><br /></p>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name = "process" action="https://processatgateway.php"
method="post" onSubmit="return CheckRequiredFields();
if(document.getElementById('payment_form_submit').disabled){alert('form already submitted, please wait.');
return false;}else{document.getElementById('payment_form_submit').disabled=true; return true;}" >
<div class="title">Please enter your personal information</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%" summary="layout" class="layout">
<tr>
<td align="right"><p>First Name</p></td>
<td><p> <input type="text" maxlength="30" size="30" name="first_name" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Last Name</p></td>
<td><p> <input type="text" maxlength="30" size="30" name="last_name" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Street Address</p></td>
<td><p> <input type="text" maxlength="100" size="50" name="street_address" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>City</p></td>
<td><p> <input type="text" maxlength="30" size="20" name="city" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>State</p></td>
<td><p> <input type="text" maxlength="30" size="20" name="state" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Zip Code</p></td>
<td><p> <input type="text" maxlength="10" size="10" name="zipcode" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Country</p></td>
<td><p> <input type="text" maxlength="30" size="30" name="country" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Telephone</p></td>
<td><p> <input type="text" maxlength="20" size="20" name="home_phone" value="" /></p></td>
<tr>
<td align="right"><p>Birth Date</p></td>
<td><p> <input type="text" maxlength="20" size="20" name="birth" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Profession</p></td>
<td><p> <SELECT NAME="profession">
<OPTION VALUE="p1">Architect</OPTION>
<OPTION VALUE="p2">Landscape Architect</OPTION>
<OPTION VALUE="p3">City Planner</OPTION>
<OPTION VALUE="p4">Developer</OPTION>
<OPTION VALUE="p5">Public Official</OPTION>
<OPTION VALUE="p6">Consumer Advocate</OPTION>
<OPTION VALUE="p7">Educator</OPTION>
<OPTION VALUE="p8">Student</OPTION>
<OPTION VALUE="p9">Other..Please Specify below</OPTION>
</SELECT></p></td>
</tr>
<tr>
<td align="right"><p>Other</p></td>
<td><p> <input type="text" maxlength="50" size="50" name="other" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Email Address</p></td>
<td><p> <input type="text" maxlength="200" size="50" name="email" value="" /></p></td>
</tr>
<tr>
<td align="right"><p>Comments</p></td>
<td><p> <textarea name="additional_comments" cols="50" rows="4" maxlength="50" ></textarea></p>
</td>
</tr>
<tr>
<td>
</td>
<td>
<p> <input type="submit" value="Proceed to Credit Card Payment Form" id="payment_form_submit" name="payment_form_submit" />
<input type="reset" value="Reset"/>
</p>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<input type="hidden" name="ubf_account" value="<?=$ubf_account?>" />
<input type="hidden" name="service_type_code" value="<?=$service_type_code?>" />
<input type="hidden" name="connecting_site_code" value="<?=$connecting_site_code?>" />
<input type="hidden" name="transaction_id" value="<?=$transaction_id?>" />
<input type="hidden" name="transaction_desc" value="<?=$transaction_desc?>" />
<input type="hidden" name="charge_amount" value="<?=$charge_amount?>" />
<input type="hidden" name="post_back_url" value="<?=$post_back_url?>" />
<input type="hidden" name="merchant_email" value="<?=$merchant_email?>" />
<input type="hidden" name="email_ind" value="<?=$email_ind?>" />
<input type="hidden" name="merchant_email_ind" value="<?=$merchant_email_ind?>" />
<input type="hidden" name="email_header" value="<?=$email_header?>" />
<input type="hidden" name="email_footer" value="<?=$email_footer?>" />
<input type="hidden" name="HtmlTitle" value="<?=$HtmlTitle?>" />
<input type="hidden" name="FormFormat" value="<?=$FormFormat?>" />
</form>
</td>
</tr>
<tr><td>
</td></tr>
</table>
</html>