INSERT form data already submitted into database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

INSERT form data already submitted into database

Post by rebbie »

helllo, i pray someone can help me. I have a simple donation HTML form that collects an amount, firstName, lastName, city, state, zip, email. This HTML form posts to a CyberSource payment gateway php page that collects secure credit card information. I cannot edit this payment gateway php page. After the end user has completed the donation process, they are taken to a receipt php page that echos all form data gathered by my HTML page & the payment gateway php page. I need to insert the echoed form data on the receipt page into a database table. Can anyone help me?
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Post by AGISB »

You have to ask your biller about this. They got all the info so they have to send you the info somehow. Possibly they can provide you with a script.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Is the receipt page editable?

If so, all you need to do is insert the values instead of echoing them, or is that what you're asking how to do?

And if that's so, google for mySQL tutorials.
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

Thank you for the replies. I am in such need of assistance. The biller, or payment gateway provider, CyberSource, will not provide me with a sript. That was the first thing I asked them for. The data I am collecting involves a Tribute Donation web page, where the end user can donate money in someone elses name & include a message & occasion. Through the CyberSource Business Center I can retrieve standard field values such as f_name, l_name, address, etc.. but I can't retrieve my custom fields/values, such as message, occassion. So I created a custom php receipt page which echoes all the fields/values that I need. The receipt page does work, but I need to store this information for the Merchant or website owner. They need to see the custom field values to carry out the donation.
So I can edit the Receipt page where the field values are echoed. I need to some how take the data from the receipt page & save it some where. Below is my custom receipt page

Code: Select all

<html>
<head>
</head>

<?php

$billTo_firstName=$HTTP_POST_VARS['billTo_firstName'];
$billTo_lastName=$HTTP_POST_VARS['billTo_lastName'];
$billTo_street1=$HTTP_POST_VARS['billTo_street1'];
$billTo_city=$HTTP_POST_VARS['billTo_city'];
$billTo_state=$HTTP_POST_VARS['billTo_state'];
$billTo_postalCode=$HTTP_POST_VARS['billTo_postalCode'];
$billTo_email=$HTTP_POST_VARS['billTo_email'];
$amount=$HTTP_POST_VARS['amount'];
$message=$HTTP_POST_VARS['message'];
$special=$HTTP_POST_VARS['special'];

?>


<body>
<table cellspacing="2" cellpadding="2" width="600">
  <tr> 
    <td align="center">Field</td>
    <td align="center">Value</td>
  </tr>
<tr> 
    <td>billTo_firstName</td>
    <td><?php echo $billTo_firstName; ?></td>
  </tr>
<tr> 
    <td>billTo_lastName</td>
    <td><?php echo $billTo_lastName; ?></td>
  </tr>
<tr> 
    <td>billTo_street1</td>
    <td><?php echo $billTo_street1; ?></td>
  </tr>
  <tr> 
    <td>billTo_city</td>
    <td><?php echo $billTo_city; ?></td>
  </tr>
    <tr> 
    <td>billTo_state</td>
    <td><?php echo $billTo_state; ?></td>
  </tr>
    <tr> 
    <td>billTo_postalCode</td>
    <td><?php echo $billTo_postalCode; ?></td>
  </tr>
<tr> 
    <td>billTo_email</td>
    <td><?php echo $billTo_email; ?></td>
  </tr>
<tr> 
    <td>amount</td>
    <td><?php echo $amount; ?></td>
  </tr>
  <tr> 
    <td>message</td>
    <td><?php echo $message; ?></td>
  </tr>
  <tr> 
    <td>special</td>
    <td><?php echo $special; ?></td>
  </tr>
</table>

</body>
</html>
Thank you for your help. I am obviously a newbie.
Rebecca
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

you can use merchantReferenceCode to map entries in your database to those in CyberSource db. Just store all the data you need, assign unique identifier and post data along with mentioned unique id to the gateway page.
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

If you are refering to the CyberSource manual, I have read it many times. CyberSource does not store the data from my custom fields. If I knew how to do this I wouldn't be asking for help & I certainly do not claim to be a PHP programmer. I am just trying to finish a job for my boss because the programmer who takes care of all PHP programming for the company is in the hospital dying of stomach cancer. His position has not been replaced yet & my company has a deadline.

Is there ANYONE else out there who could help me figure out how to receive & save fields/values from an HTML form that is posted to a payment gateway?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

rebbie wrote:If you are refering to the CyberSource manual, I have read it many times. CyberSource does not store the data from my custom fields.
and they should not as there's a way to establish a relation between your records and theirs using referenceCode.
rebbie wrote: If I knew how to do this I wouldn't be asking for help & I certainly do not claim to be a PHP programmer. I am just trying to finish a job for my boss because the programmer who takes care of all PHP programming for the company is in the hospital dying of stomach cancer. His position has not been replaced yet & my company has a deadline.
I'm sorry for your programmer. It's not the reason for me to do his work, though. If you didn't understand the solution I proposed you might have asked for further explanation.
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

You are correct. I really don't understand the solution you offered. As you can tell, I have never done this before. I was amazed that I got the receipt page to work, if that tells you anything. I work for a small Multi-Media company. My primary job is creating Marketing & Training CDRoms & DVDs, and Business Presentations. I also do the HTML programming, but I know very little about PHP. Our website programmer suddenly became ill. He will have to replaced, but in the meantime I have been asked to try and finish this one project. I have to at least try.

So I will look up referenceCode and establishing a relationship between databases. Am I headed in the right direction? Thank you for your time & suggestions.

r
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

rebbie wrote: So I will look up referenceCode and establishing a relationship between databases. Am I headed in the right direction?
I think so. It's been a while since I used CS last time and that code was proprietary. I will need to know what type of integration you use (Simple Order/SCMP/Hosted Order page/something else).
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

I am using the Hosted Order Page - HOP.php

thank you for your help
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

Although I was asked not to edit the HOP.php, I can download it from the server and post it here if you need to look at it.

Thanks
rebbie
Forum Newbie
Posts: 7
Joined: Thu Oct 28, 2004 12:24 pm

Post by rebbie »

I just wanted to let you know that I FINALLY got it to work. Thank you all for your time.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Glad you have it sorted.
Post Reply