Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP Problems

Form Email and Values Passed On

7:36 am on May 17, 2004 (gmt 0)

10+ Year Member

Hey all

I currently have a PHP problem. Firstly this is the situation I am currently in:

1. There is a form where the user fills in their details and clicks 'next'.
2. These details are then sent to a php page where the fields are emailed to a set email address and the values from the first form are sent to a payment page with code that ends:

header("Location: https://www.paymentpage.com/index.php?grand_total=$grand_total&billing_first_name= $billing_first_name&billing_last_name=$billing_last_name&billing_email=$billing_email &billing_phone=$billing_phone&billing_address=$billing_address&billing_address2= $billing_address2&billing_city=$billing_city&billing_state=$billing_state&billing_province= $billing_province&billing_zip=$billing_zip&billing_country=$billing_country");

Now this works fine apart from the fact that the payment page doesn't like the values being passed this way. They say that it has to be done using post. Can this somehow be achieved.

Please be gentle as I don't know much about PHP!



[edited by: jatar_k at 5:26 pm (utc) on May 17, 2004]
[edit reason] broke url to fix sidescroll [/edit]

10:12 am on May 17, 2004 (gmt 0)

10+ Year Member

you should read about cURL [php.net] about post variables via SSL and PHP

This is just a simple code, I using to connect to authorize.net
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); // set the fields to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // make sure we get the response back

$buffer = curl_exec($ch); // execute the post

curl_close($ch); // close our session


At the $fields, you should put all of your variables.

At $buffer you will have the results or the server output.

Note, your server must support cURL functions and the PHP must be compilied with curl.

11:39 am on May 17, 2004 (gmt 0)

10+ Year Member

Thanks for the reply.

Unfortunately there's no CURL installed. How difficult is it to install?



12:05 pm on May 17, 2004 (gmt 0)

10+ Year Member

James, what you need is to define the variables and then 'post' them to the next page.

In your form you have something like this:

<form id="update" method="post" action="update.php">
<input name="email" type="text">

Then in update.php you have something like this at the top of the script (depending on your PHP version):

$email= $_POST['email'];

[edit]woops, didn't see the SSL part. Wasn't sure what you wanted to know exactly.[/edit]

1:47 pm on May 17, 2004 (gmt 0)

10+ Year Member

Unfortunately the payment page doesn't seem to like this setup Aussie_Dave. This is the way that I am doing it at the moment but it doesn't like a second php document sending the variables along the lines of:




[edited by: jatar_k at 5:27 pm (utc) on May 17, 2004]
[edit reason] generalized url [/edit]

2:25 pm on May 17, 2004 (gmt 0)

10+ Year Member

What system are you using exactly? I don't think it will breach the Terms of Service if you name the payment service; someone may be familiar with the particular gateway and be able to offer a solution.
2:37 pm on May 17, 2004 (gmt 0)

10+ Year Member

Of course. It's EchoPay by Merchant America.