Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2009
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help capture data from previous page to next when submit button click

    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.
    PHP Code:
    <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);" />  
                 
                
        </div>
    <fieldset class="buttons" >
      <input type="submit" name="do" value="Submit" onClick="CalculateTotal(this.value,99);" />
    </fieldset>
    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:

    PHP Code:
     <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.

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Look into PHP session variables for this. Google can get you started out pretty easily.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    New Coder
    Join Date
    Oct 2009
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    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%.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #5
    New Coder
    Join Date
    Oct 2009
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •