Page 1 of 1

Need a little help with my code

Posted: Wed Jul 23, 2008 10:53 am
by Sepsis2x
Before I post my code, let me tell you what you're looking at. I'm working on an ecommerce section for the company I work for. The code you are looking at is to determine if the customer needs to pay sales tax. It then automatically submits the form with all their information to paypal.

Code: Select all

<body onLoad="document.process.submit()">
<?php
$NAME = $_POST['NAME'];
$USER1 = $_POST['USER1'];
$ADDRESS = $_POST['ADDRESS'];
$CITY = $_POST['CITY'];
$STATE = $_POST['STATE'];
$ZIP = $_POST['ZIP'];
$PHONE = $_POST['PHONE'];
$EMAIL = $_POST['EMAIL'];
$FAX = $_POST['FAX'];
$CustID = $_POST['CustID'];
$NAMETOSHIP = $_POST['NAMETOSHIP'];
$USER2 = $_POST['USER2'];
$ADDRESSTOSHIP = $_POST['ADDRESSTOSHIP'];
$CITYTOSHIP = $_POST['CITYTOSHIP'];
$STATETOSHIP = $_POST['STATETOSHIP'];
$ZIPTOSHIP = $_POST['ZIPTOSHIP'];
$PHONETOSHIP = $_POST['PHONETOSHIP'];
$EMAILTOSHIP = $_POST['EMAILTOSHIP'];
$FAXTOSHIP = $_POST['FAXTOSHIP'];
$total = $_POST['total']; 
echo $total;
if ($STATE=="UT"){
$total+=15.18;
}
echo $total;
?>
<form action="http://payments.verisign.com/payflowlink" name="process" method="post">
<input type="hidden" name="NAME" value=<? echo $NAME; ?>>
<input type="hidden" name="USER1" value=<? echo $USER1; ?>>
<input type="hidden" name="ADDRESS" value=<? echo $ADDRESS; ?>>
<input type="hidden" name="CITY" value=<? echo $CITY; ?>>
<input type="hidden" name="STATE" value=<? echo $STATE; ?>>
<input type="hidden" name="ZIP" value=<? echo $ZIP; ?>>
<input type="hidden" name="PHONE" value=<? echo $PHONE; ?>>
<input type="hidden" name="EMAIL" value=<? echo $EMAIL; ?>>
<input type="hidden" name="FAX" value=<? echo $FAX; ?>>
<input type="hidden" name="CustID" value=<? echo $CustID; ?>>
<input type="hidden" name="NAMETOSHIP" value=<? echo $NAMETOSHIP; ?>>
<input type="hidden" name="USER2" value=<? echo $USER2; ?>>
<input type="hidden" name="ADDRESSTOSHIP" value=<? echo $ADDRESSTOSHIP; ?>>
<input type="hidden" name="CITYTOSHIP" value=<? echo $CITYTOSHIP; ?>>
<input type="hidden" name="STATETOSHIP" value=<? echo $STATETOSHIP; ?>>
<input type="hidden" name="ZIPTOSHIP" value=<? echo $ZIPTOSHIP; ?>>
<input type="hidden" name="PHONETOSHIP" value=<? echo $PHONETOSHIP; ?>>
<input type="hidden" name="EMAILTOSHIP" value=<? echo $EMAILTOSHIP; ?>>
<input type="hidden" name="FAXTOSHIP" value=<? echo $FAXTOSHIP; ?>>
<input type="hidden" name="AMOUNT" value=<?php echo $total; ?>>
                
</form>
 
</body>
</html>
 
Now, I know that I don't have the code to actually log into paypal on here. I didn't think it wise to post that. Now, the problem I'm having is that after my form submits, it goes to the firefox "problem loading page- cannot establish a connection to the server at payment.verisign.com."

I've tried sending the information to different pages on my site, and it doesn't work. So I'm at a loss.

Re: Need a little help with my code

Posted: Wed Jul 23, 2008 12:23 pm
by Zoxive
The website you are posting to must be secured.

You are posting to http://payments.verisign.com/payflowlink when it needs to be https://payments.verisign.com/payflowlink

Re: Need a little help with my code

Posted: Wed Jul 23, 2008 12:36 pm
by Sepsis2x
Oh, awesome! I'm new to this is my first experience with php/forms and I had no idea about any of that.