View Full Version : Help capture data from previous page to next when submit button click

11-07-2009, 03:30 AM
Hi. Please help. I have a credit card donation page and what I wanted to do is after they click the submit button and transaction is successful I wanted to capture the donation amount they enter from the donation page and show it to the next page. I know that is possible but I just don't know how to do it. I am still learning using PHP and still consider as a baby. My first page form looks like below which needs to authorize the transaction by clicking the submit button.
<h2>Donation Information</h2>
<fieldset class="radiogroup<?php echo highlight('donate_amount'); ?> ">
<legend>Please specify the amount of money you would like to give.<b style="color:#FF0000">*</b></legend>
<?php foreach ($preset_amounts as $amount) : ?>
<label><input name="donate_amount" id="donate_amount<?php echo $amount; ?>" class="radio" type="radio"
value="<?php echo $amount; ?>" <?php echo helper_checked($form['donate_amount'] == $amount) ?>
onclick="CalculateTotal(this.value,99);" />$<?php echo $amount; ?></label>
<?php endforeach; ?>
<br />
<label id="fld-donate_other"><input id="donate_other" name="donate_amount" class="radio" type="radio"
value="other" <?php echo helper_checked($form['donate_amount'] == 'other') ?>
onclick="document.getElementById('donate_amount_other').disabled=false;" /> Other </label>
<div id="fld-donate_amount_other" class="formfield" onclick="document.getElementById('donate_amount_other').disabled=false; document.getElementById('donate_other').checked=true; document.getElementById('donate_amount_other').focus();">
<label for="donate_amount_other">Other Amount: $</label>
<input id="donate_amount_other" name="donate_amount_other" class="text" type="text"
value="<?php safeEcho($form['donate_amount_other']) ?>" <?php echo helper_disabled(!$form['donate_amount_other']); ?> onchange="CalculateTotal(this.value,99);" />

<fieldset class="buttons" >
<input type="submit" name="do" value="Submit" onClick="CalculateTotal(this.value,99);" />
and once the transaction is complete and successful, I'd like the user to give an option and send them to another page where they can enter more information but I wanted to retrieve one information from the first page to the second page after the transaction is successful. My second page should look like below which the donation amount should capture automatically from the previous page:

<label>Donation Amount: $</label>
<input name="TotalDonate" id="TotalDonate" type="text" maxlength="10" readonly="true" onClick="CalculateTotal(this.value,99);" />

Can someone please help? Thanks in advance.

11-07-2009, 10:48 PM
Look into PHP session variables for this. Google can get you started out pretty easily.

11-09-2009, 12:48 AM
Hi, thanks for your help and I didn't get that much information. I tried to use SESSION_VARIABLES but it didn't give anything when I go to the next page. I just want one piece of information from the donate page to show it to the next page once the transaction is authorize and complete from our merchant account. Please help and if possible to include some code also because I don't really know what I have to do. I am so desperate and about to give up. Please help!!!!! Thansk.

11-09-2009, 03:49 PM
You need to look into "Look into PHP session variables for this." By which I mean you will need to learn to use PHP session variables.

When I say that "Google can get you started out pretty easily." I mean that you need to go to google.com, type in "php session variables", click on the "google search" button, and then start to visit the sites returned from that search. While visiting you should read up on the use/implementation of PHP sessions and session variables.

YOU will need to do some research on this. It's an independent study lesson. Once you have done some reading and tried out some code you should post back with your example page and the PHP script you are using. I'll be happy to help you get your code working but only after you have put in some effort of your own on it. Hopefully you can understand why.

Otherwise, you should probably post the request on the paid work forum and hire someone to do the legwork for you 100%.

02-09-2010, 12:02 AM
Hi Rowsdower. Thanks for your help. I finally have to chance to work on session variables and although I never try if it works on me, I understand how it works. Thanks for the insight.