cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Trouble getting response during TransFirst integration

From: Chris J. Zähller <chris_at_messengerwebdesign.com>
Date: Wed, 29 Dec 2010 12:27:37 -0600

I'm trying to get a payment form to work with TransFirst and not getting
back a response. Their integration specialists suggested I post here.
The results I'm getting back look like this:
> https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp?MerchantID=xxxxxx&RegKey=xxxxxx&NameonAccount=Joe+Bob+Q+Public+Jr&AccountNo=4929562087497169&CVV2=123&CCMonth=10&CCYear=11&AVSADDR=&AVSZIP=55555-5555&Amount=25.00&USER1=555-555-5555&USER2=foo@bar.com&USER3=Woot?+Foo.+Just+a+test.&CCRURL=
>
>
>
>
> NULL Transaction declined
>
> Error= Error No.=0 Info=Array
As you can see, the response is either NULL or blank. Any ideas what I
might be doing wrong?

This is a simplified version of the form, without the error-checking &
input sanitizing. Merchant ID & Reg Key are replaced with "xxxxxx" in
this example:
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <title>TransFirst Integration Test</title>
> </head>
> <body>
> <?php
> // pre-fill form for testing only; trim function removes leading &
> trailing spaces!
> $_POST['firstName']=" Joe Bob ";
> $_POST['MI']="Q";
> $_POST['lastName']="Public Jr";
> $_POST['AccountNo']="4929 5620 8749 7169";
> $_POST['CVV2']=" 123";
> $_POST['CCMonth']="10";
> $_POST['CCYear']="11";
> $_POST['Amount']=" 25.00";
> $_POST['address']=" 100 Main Street ";
> $_POST['city']=" Any Town ";
> $_POST['state']="OK";
> $_POST['AVSZIP']=" 55555-5555 ";
> $_POST['phone']=" 555 555 5555 ";
> $_POST['email']="foo_at_bar.com";
> $_POST['comment']=" Woot? Foo. Just a test. ";
> ?>
> <form action="<?php echo $_SERVER['REQUEST_URI']; ?>"method="post">
> <?php
>
> //If form is reset
> if(isset($_POST['reset'])) {
> unset($_POST);
> }
>
> // If the form is submitted
> if((isset($_POST['verify']))||(isset($_POST['submit']))) {
> //Create individual variables from $_POST
> extract($_POST);
>
> // Trim function
> function trim_value(&$value)
> {
> $value = trim($value);
> }
>
> // Format acct. holder name for user & cURL
> $array_name = array("firstName" => $_POST['firstName'], // for
> both user & cURL
> "MI" => $_POST['MI'],
> "lastName" => $_POST['lastName']
> );
>
> array_walk($array_name, 'trim_value');
> $nameOut = implode(" ", $array_name); // for user
> $NameonAccount = str_replace (" ", "+", $nameOut); // for cURL
>
> // Format address for user & cURL
> $array_addr = array("address" => $_POST['address']." ", // for user
> "city" => $_POST['city'],
> "state" => $_POST['state']
> );
>
> array_walk($array_addr, 'trim_value');
>
> $addrOut = implode(" ", $array_addr); // for user
> $AVSADDR = str_replace (" ", "+", $AVSADDR); // for cURL
>
> // Remove whitespace
> $AVSZIP = str_replace (" ", "", $AVSZIP);
> $AccountNo = str_replace('-','', $AccountNo);
> $AccountNo = str_replace(' ','', $AccountNo);
> $CVV2 = str_replace (" ", "", $CVV2);
> $Amount = str_replace (" ", "", $Amount);
>
> $phone = trim($phone);
> $email = trim($email);
> $comment = trim($comment);
>
> $USER1 = str_replace (" ", "-", $phone); // for cURL
> $USER3 = str_replace (" ", "+", $comment); // for cURL
>
>
> $array_out = array("MerchantID" => "xxxxxx",
> "RegKey" => "xxxxxx",
> "NameonAccount" => $NameonAccount,
> "AccountNo" => $AccountNo,
> "CVV2" => $CVV2,
> "CCMonth" => $_POST['CCMonth'],
> "CCYear" => $_POST['CCYear'],
> "AVSADDR" => $AVSADDR,
> "AVSZIP" => $AVSZIP,
> "Amount" => $Amount,
> "USER1" => $USER1,
> "USER2" => $email,
> "USER3" => $USER3,
> "CCRURL" => "" // change to
> "http://foodandshelterinc.org/donation-successful"?
> );
>
> // form validation omitted for clarity
>
>
> $message="------------------------------------------------------------
> 1. Cardholder Info
> ------------------------------------------------------------
> BILLING INFO.
> Name | ".htmlspecialchars($nameOut, ENT_NOQUOTES,
> 'UTF-8')."
> Address | ".htmlspecialchars($array_addr["address"],
> ENT_NOQUOTES, 'UTF-8')."
> ".htmlspecialchars($array_addr["city"], ENT_NOQUOTES,
> 'UTF-8').", ".htmlspecialchars($array_addr["state"], ENT_NOQUOTES,
> 'UTF-8')." ".htmlspecialchars($AVSZIP, ENT_NOQUOTES, 'UTF-8')."
> Tel. | ".htmlspecialchars($USER1, ENT_NOQUOTES, 'UTF-8')."
> E-mail | ".htmlspecialchars($email, ENT_NOQUOTES,
> 'UTF-8')."
> ------------------------------------------------------------
> 2. Credit Card
> Account No. | ".htmlspecialchars($AccountNo, ENT_NOQUOTES,
> 'UTF-8')."
> CVV2 Code | ".htmlspecialchars($CVV2, ENT_NOQUOTES, 'UTF-8')."
> Exp. Month | ".htmlspecialchars($CCMonth, ENT_NOQUOTES,
> 'UTF-8')."
> Exp. Year | 20".htmlspecialchars($CCYear, ENT_NOQUOTES,
> 'UTF-8')."
> ------------------------------------------------------------
> 3. Donation
> Amount | $".htmlspecialchars($Amount, ENT_NOQUOTES,
> 'UTF-8')."
> ------------------------------------------------------------
> 4. Other
> Comment | ".htmlspecialchars($comment, ENT_NOQUOTES,
> 'UTF-8')."
> ------------------------------------------------------------";
>
> if(isset($_POST['verify'])) {
> echo "<fieldset><legend>Verify &amp; Send</legend><p>Please
> check your form submission. When you are satisfied that the
> information is correct, click the &ldquo;Send Form&rdquo; button
> (located <a href='#submit'>here</a>) <em>only
> once.</em></p><p><pre>".$message."</pre></p><label for='submit'>If you
> are satisfied that your information is correct, click &ldquo;Send
> Form&rdquo; button only once. Otherwise, scroll down to make
> corrections and click &ldquo;Verify&rdquo;.</label><div
> style='float:right;width:395px;text-align:center;'><button
> type=\"submit\" class=\"submit\" name=\"submit\" id=\"submit\"
> style='margin:55px auto auto;'>Send Form</button></div></fieldset>";
> }
>
> if(isset($_POST['submit'])) {
> //convert the array into a postable format
> foreach($array_out as $key => $val){
> $separator = (isset($array_out)) ? "&" : "";
> $array_out .= $separator.$key."=".$val;
> }
>
> $array_out_trim = explode("&", $array_out);
>
> $trim1 = $array_out_trim[1]; // trim2
> $trim2 = "&".$array_out_trim[2]; // trim3
> $trim3 = "&".$array_out_trim[3]; // trim4 etc.
> $trim4 = "&".$array_out_trim[4];
> $trim5 = "&".$array_out_trim[5];
> $trim6 = "&".$array_out_trim[6];
> $trim7 = "&".$array_out_trim[7];
> $trim8 = "&".$array_out_trim[8];
> $trim9 = "&".$array_out_trim[9];
> $trim10 = "&".$array_out_trim[10];
> $trim11 = "&".$array_out_trim[11];
> $trim12 = "&".$array_out_trim[12];
> $trim13 = "&".$array_out_trim[13];
> $trim14 = "&".$array_out_trim[14];
>
> $array_out_trim =
> array($trim1,$trim2,$trim3,$trim4,$trim5,$trim6,$trim7,$trim8,$trim9,$trim10,$trim11,$trim12,$trim13,$trim14);
>
> $array_out = implode("", $array_out_trim);
> $array_out =
> "https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp?".$array_out;
>
>
> print "<fieldset><legend>Transaction Result</legend>";
> print $array_out; // disable this on production server
>
> /* //send the data to the address url
>
> $ch=curl_init('https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp?');
>
> curl_setopt($ch,CURLOPT_POST,1);
> curl_setopt($ch,CURLOPT_POSTFIELDS,$array_out);
> curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
> curl_setopt($ch, CURLOPT_VERBOSE, 1);
>
> // get the response back from the url
> $result = curl_exec($ch);
>
> //define $result_array
> $result_array=array();
>
> //now process that url to see what it says, storing the
> results in $result_array …
> parse_str($result, $result_array);
>
> // close curl resource to free up system resources
> curl_close($ch);
> */
>
> $ch = curl_init();
>
> curl_setopt($ch, CURLOPT_URL,
> "https://webservices.primerchants.com/billing/TransactionCentral/processCC.asp");
>
> curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE
> 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)");
> curl_setopt($ch, CURLOPT_TIMEOUT, 900);
> curl_setopt($ch, CURLOPT_CONNECTIONTIMEOUT, 30);
> curl_setopt($ch, CURLOPT_FAILONERROR, false);
>
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $array_out);
>
> $commError = curl_error($ch);
> $commErrNo = curl_errno($ch);
>
> $commInfo = @curl_getinfo($ch);
>
> if($Live){ #This is a Live Test if Live is on ...
> $tc_response = curl_exec($ch);
> curl_close($ch);
> }
>
> //check the result array you just created to see if the
> transaction was approved.
> if($result_array['Auth'] != 'Declined' &&
> !empty($result_array['Auth'])){ // next 5 lines for testing only
> print $result."<br /><br />";
> print $result_array."<br /><br />";
> print "Error=".$commError." Error No.=".$commErrNo."
> Info=".$commInfo."<br /><br />";
> var_dump ($result_array['Auth']);
> print " Transaction accepted";
> //header("Location:
> http://foodandshelterinc.org/donation-successful");
> }
> else { // next 5 lines for testing only
> print $result."<br /><br />";
> print $result_array."<br /><br />";
> print "Error=".$commError." Error No.=".$commErrNo."
> Info=".$commInfo."<br /><br />";
> var_dump ($result_array['Auth']);
> print " Transaction declined<br /><br />";
> //header("Location:
> http://foodandshelterinc.org/transaction-declined");
> }
>
> print "</fieldset>";
> }
> }
> ?>
> <fieldset>
> <legend >Cardholder Information</legend>
> <fieldset>
> <legend >Name on Card</legend>
> <input type="hidden" name="SpamFood" id="SpamFood" maxlength="60" />
> <br />
> <label for="firstName" title="First Name" class="required">First
> Name</label>
> <input type="text" name="firstName" id="firstName" value="<?php
> if(isset($_POST['firstName'])){echo htmlentities($_POST['firstName'])
> ?><?php } ?>" maxlength="13" />
> <br />
> <label for="MI" title="MI">MI</label>
> <input type="text" name="MI" id="MI" value="<?php
> if(isset($_POST['MI'])){echo htmlentities($_POST['MI']) ?><?php } ?>"
> maxlength="1" size="1" />
> <br />
> <label for="lastName" title="Last Name" class="required">Last
> Name</label>
> <input type="text" name="lastName" id="lastName" value="<?php
> if(isset($_POST['lastName'])){echo htmlentities($_POST['lastName'])
> ?><?php } ?>" maxlength="14" />
> </fieldset>
> <label for="AccountNo" class="required">Account Number</label>
> <input type="text" name="AccountNo" id="AccountNo" value="<?php
> if(isset($_POST['AccountNo'])){echo htmlentities($_POST['AccountNo'])
> ?><?php } ?>" maxlength="19" />
> <br />
> <label for="CVV2" class="required"><a href='http://www.cvvnumber.com/'
> title='Where is the CVV2 (security code) number?'
> target='_blank'>Security Code</a></label>
> <input type="text" name="CVV2" id="CVV2" value="<?php
> if(isset($_POST['CVV2'])){echo htmlentities($_POST['CVV2']) ?><?php }
> ?>" maxlength="4" size="4" />
> <br />
> <label for="CCMonth" class="required">Exp. Month</label>
> <select name="CCMonth" id="CCMonth">
> <optgroup label="Expiration Month">
> <option value="" selected="selected">Choose One</option>
> <option value="01" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="01")){echo "selected=\"selected\""; ?><?php }
> ?>>January</option>
> <option value="02" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="02")){echo "selected=\"selected\""; ?><?php }
> ?>>February</option>
> <option value="03" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="03")){echo "selected=\"selected\""; ?><?php }
> ?>>March</option>
> <option value="04" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="04")){echo "selected=\"selected\""; ?><?php }
> ?>>April</option>
> <option value="05" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="05")){echo "selected=\"selected\""; ?><?php }
> ?>>May</option>
> <option value="06" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="06")){echo "selected=\"selected\""; ?><?php }
> ?>>June</option>
> <option value="07" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="07")){echo "selected=\"selected\""; ?><?php }
> ?>>July</option>
> <option value="08" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="08")){echo "selected=\"selected\""; ?><?php }
> ?>>August</option>
> <option value="09" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="09")){echo "selected=\"selected\""; ?><?php }
> ?>>September</option>
> <option value="10" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="10")){echo "selected=\"selected\""; ?><?php }
> ?>>October</option>
> <option value="11" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="11")){echo "selected=\"selected\""; ?><?php }
> ?>>November</option>
> <option value="12" <?php if((isset($_POST['CCMonth'])) &&
> ($_POST["CCMonth"]=="12")){echo "selected=\"selected\""; ?><?php }
> ?>>December</option>
> </optgroup>
> </select>
> <br />
> <label for="CCMonth" class="required">Exp. Year</label>
> <select name="CCYear" id="CCYear">
> <optgroup label="Year">
> <option value="" selected="selected">Choose One</option>
> <option value="<?php echo date('y'); ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y'))){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y'); ?></option>
> <option value="<?php echo date('y')+1; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+1)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+1; ?></option>
> <option value="<?php echo date('y')+2; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+2)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+2; ?></option>
> <option value="<?php echo date('y')+3; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+3)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+3; ?></option>
> <option value="<?php echo date('y')+4; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+4)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+4; ?></option>
> <option value="<?php echo date('y')+5; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+5)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+5; ?></option>
> <option value="<?php echo date('y')+6 ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+6)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+6; ?></option>
> <option value="<?php echo date('y')+7; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+7)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+7; ?></option>
> <option value="<?php echo date('y')+8; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+8)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+8; ?></option>
> <option value="<?php echo date('y')+9; ?>" <?php
> if((isset($_POST['CCYear'])) && ($_POST["CCYear"]==date('y')+9)){echo
> "selected=\"selected\""; ?><?php } ?>><?php echo date('Y')+9; ?></option>
> </optgroup>
> </select>
> <br />
> </fieldset>
> <fieldset>
> <legend >Donation Amount</legend>
> <label for="Amount" class="required">Amount</label>
> $
> <input type="text" name="Amount" id="Amount" value="<?php
> if(isset($_POST['Amount'])){echo htmlentities($_POST['Amount'])
> ?><?php } ?>" maxlength="8" size="8" />
> </fieldset>
> <fieldset>
> <legend >Billing Address</legend>
> <label for="address" class="required">Street</label>
> <input type="text" name="address" id="address" value="<?php
> if(isset($_POST['address'])){echo htmlentities($_POST['address'])
> ?><?php } ?>" maxlength="35" />
> <br />
> <label for="city" class="required">City</label>
> <input type="text" name="city" id="city" value="<?php
> if(isset($_POST['city'])){echo htmlentities($_POST['city']) ?><?php }
> ?>" maxlength="20" />
> <br />
> <label for="state" class="required">State / Territory</label>
> <select name="state" id="state" tabindex="">
> <option value="">Choose One </option>
> <optgroup label="States">States</optgroup>
> <option value="OK" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="OK")){echo "selected=\"selected\""; ?><?php }
> ?>>Oklahoma </option>
> <option value="AL" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AL")){echo "selected=\"selected\""; ?><?php }
> ?>>Alabama </option>
> <option value="AK" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AK")){echo "selected=\"selected\""; ?><?php }
> ?>>Alaska </option>
> <option value="AR" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AR")){echo "selected=\"selected\""; ?><?php }
> ?>>Arkansas </option>
> <option value="AZ" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AZ")){echo "selected=\"selected\""; ?><?php }
> ?>>Arizona </option>
> <option value="CA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="CA")){echo "selected=\"selected\""; ?><?php }
> ?>>California </option>
> <option value="CO" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="CO")){echo "selected=\"selected\""; ?><?php }
> ?>>Colorado </option>
> <option value="CT" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="CT")){echo "selected=\"selected\""; ?><?php }
> ?>>Connecticut </option>
> <option value="DE" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="DE")){echo "selected=\"selected\""; ?><?php }
> ?>>Delaware </option>
> <option value="DC" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="DC")){echo "selected=\"selected\""; ?><?php }
> ?>>District of Columbia </option>
> <option value="FL" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="FL")){echo "selected=\"selected\""; ?><?php }
> ?>>Florida </option>
> <option value="GA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="GA")){echo "selected=\"selected\""; ?><?php }
> ?>>Georgia </option>
> <option value="HI" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="HI")){echo "selected=\"selected\""; ?><?php }
> ?>>Hawaii </option>
> <option value="ID" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="ID")){echo "selected=\"selected\""; ?><?php }
> ?>>Idaho </option>
> <option value="IL" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="IL")){echo "selected=\"selected\""; ?><?php }
> ?>>Illinios </option>
> <option value="IN" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="IN")){echo "selected=\"selected\""; ?><?php }
> ?>>Indiana </option>
> <option value="IA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="IA")){echo "selected=\"selected\""; ?><?php }
> ?>>Iowa </option>
> <option value="KS" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="KS")){echo "selected=\"selected\""; ?><?php }
> ?>>Kansas </option>
> <option value="KY" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="KY")){echo "selected=\"selected\""; ?><?php }
> ?>>Kentucky </option>
> <option value="LA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="LA")){echo "selected=\"selected\""; ?><?php }
> ?>>Louisiana </option>
> <option value="ME" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="ME")){echo "selected=\"selected\""; ?><?php }
> ?>>Maine </option>
> <option value="MA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MA")){echo "selected=\"selected\""; ?><?php }
> ?>>Massachusetts </option>
> <option value="MD" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MD")){echo "selected=\"selected\""; ?><?php }
> ?>>Maryland </option>
> <option value="MI" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MI")){echo "selected=\"selected\""; ?><?php }
> ?>>Michigan </option>
> <option value="MN" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MN")){echo "selected=\"selected\""; ?><?php }
> ?>>Minnesota </option>
> <option value="MS" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MS")){echo "selected=\"selected\""; ?><?php }
> ?>>Mississippi </option>
> <option value="MO" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MO")){echo "selected=\"selected\""; ?><?php }
> ?>>Missouri </option>
> <option value="MT" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MI")){echo "selected=\"selected\""; ?><?php }
> ?>>Montana </option>
> <option value="NE" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NE")){echo "selected=\"selected\""; ?><?php }
> ?>>Nebraska </option>
> <option value="NV" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NV")){echo "selected=\"selected\""; ?><?php }
> ?>>Nevada </option>
> <option value="NH" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NH")){echo "selected=\"selected\""; ?><?php }
> ?>>New Hampshire </option>
> <option value="NJ" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NJ")){echo "selected=\"selected\""; ?><?php }
> ?>>New Jersey </option>
> <option value="NM" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NM")){echo "selected=\"selected\""; ?><?php }
> ?>>New Mexico </option>
> <option value="NY" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NY")){echo "selected=\"selected\""; ?><?php }
> ?>>New York </option>
> <option value="NC" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="NC")){echo "selected=\"selected\""; ?><?php }
> ?>>North Carolina </option>
> <option value="ND" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="ND")){echo "selected=\"selected\""; ?><?php }
> ?>>North Dakota </option>
> <option value="OH" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="OH")){echo "selected=\"selected\""; ?><?php }
> ?>>Ohio </option>
> <option value="OK">Oklahoma </option>
> <option value="OR" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="OR")){echo "selected=\"selected\""; ?><?php }
> ?>>Oregon </option>
> <option value="PA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="PA")){echo "selected=\"selected\""; ?><?php }
> ?>>Pennsylvania </option>
> <option value="RI" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="RI")){echo "selected=\"selected\""; ?><?php }
> ?>>Rhode Island </option>
> <option value="SC" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="SC")){echo "selected=\"selected\""; ?><?php }
> ?>>South Carolina </option>
> <option value="SD" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="SD")){echo "selected=\"selected\""; ?><?php }
> ?>>South Dakota </option>
> <option value="TN" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="TN")){echo "selected=\"selected\""; ?><?php }
> ?>>Tennessee </option>
> <option value="TX" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="TX")){echo "selected=\"selected\""; ?><?php }
> ?>>Texas </option>
> <option value="UT" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="UT")){echo "selected=\"selected\""; ?><?php }
> ?>>Utah </option>
> <option value="VT" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="VT")){echo "selected=\"selected\""; ?><?php }
> ?>>Vermont </option>
> <option value="VA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="VA")){echo "selected=\"selected\""; ?><?php }
> ?>>Virginia </option>
> <option value="WA" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="WA")){echo "selected=\"selected\""; ?><?php }
> ?>>Washington </option>
> <option value="WV" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="WV")){echo "selected=\"selected\""; ?><?php }
> ?>>West Virginia </option>
> <option value="WI" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="WI")){echo "selected=\"selected\""; ?><?php }
> ?>>Wisconson </option>
> <option value="WY" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="WY")){echo "selected=\"selected\""; ?><?php }
> ?>>Wyoming </option>
> <optgroup label="Territories">Territories</optgroup>
> <option value="AS" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AS")){echo "selected=\"selected\""; ?><?php }
> ?>>American Samoa </option>
> <option value="FM" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="FM")){echo "selected=\"selected\""; ?><?php }
> ?>>F.S. of Micronesia </option>
> <option value="GU" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="GU")){echo "selected=\"selected\""; ?><?php }
> ?>>Guam </option>
> <option value="MH" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MH")){echo "selected=\"selected\""; ?><?php }
> ?>>Marshall Islands </option>
> <option value="MP" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="MP")){echo "selected=\"selected\""; ?><?php }
> ?>>Northern Mariana Islands </option>
> <option value="PW" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="PW")){echo "selected=\"selected\""; ?><?php }
> ?>>Palau </option>
> <option value="PR" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="PR")){echo "selected=\"selected\""; ?><?php }
> ?>>Puerto Rico </option>
> <option value="VI" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="VI")){echo "selected=\"selected\""; ?><?php }
> ?>>Virgin Islands </option>
> <optgroup label="US Armed Forces">US Armed Forces</optgroup>
> <option value="AE Africa" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AE Africa")){echo "selected=\"selected\""; ?><?php
> } ?>>Armed Forces Africa </option>
> <option value="AA">Armed Forces Americas </option>
> <option value="AE Canada" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AE Canada")){echo "selected=\"selected\""; ?><?php
> } ?>>Armed Forces Canada </option>
> <option value="AE Europe" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AE Europe")){echo "selected=\"selected\""; ?><?php
> } ?>>Armed Forces Europe </option>
> <option value="AE Middle East" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AE Middle East")){echo "selected=\"selected\"";
> ?><?php } ?>>Armed Forces Middle East </option>
> <option value="AP" <?php if((isset($_POST['state'])) &&
> ($_POST["state"]=="AP")){echo "selected=\"selected\""; ?><?php }
> ?>>Armed Forces Pacific </option>
> </select>
> <label for="AVSZIP" class="required">5- or opt. 9-digit ZIP</label>
> <input type="text" name="AVSZIP" id="AVSZIP" value="<?php
> if(isset($_POST['AVSZIP'])){echo htmlentities($_POST['AVSZIP'])
> ?><?php } ?>" maxlength="10" size="10" />
> <br />
> <label for="phone" class="required">Billing Phone + opt. Ext.</label>
> <input type="text" name="phone" id="phone" value="<?php
> if(isset($_POST['phone'])){echo htmlentities($_POST['phone']) ?><?php
> } ?>" maxlength="19" size="19" />
> <br />
> </fieldset>
> <fieldset>
> <legend >Other</legend>
> <label for="email">Email</label>
> <input type="text" name="email" id="email" value="<?php
> if(isset($_POST['email'])){echo htmlentities($_POST['email']) ?><?php
> } ?>" maxlength="150" />
> <br />
> <label for="comment" class="blockLabel">Comments <span
> style="color:red;"><em>(150 characters max.)</em></span></label>
> <textarea name="comment" id="comment" tabindex="" cols="48"
> rows="5"><?php if(isset($_POST['comment'])){echo
> htmlentities($_POST['comment']) ?><?php } ?>
> </textarea>
> <button type="submit" class="submit" name="verify"
> id="verify">Submit</button>
> <button type="submit" class="submit" name="reset"
> id="reset">Reset</button>
> </fieldset>
> </form>
> </body>
> </html>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php

Received on 2010-12-30