Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8150675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:08:05+00:00 2026-06-06T15:08:05+00:00

As i am a beginner and i am stucked in a situation. Note: Email

  • 0

As i am a beginner and i am stucked in a situation. Note: Email sending code present in thankyou.php

My problem is i have to store the Date selected and pass to another page after completion of payment through paypal. I have tried php session but dont where i am lagging.

After success full transaction i am getting all the details in $_POST from the paypal like txn_id, payer_email etc but i am not getting the date which i selected in form.

Please help me to the right direction.

I am working on paypal integration and i have 1 form in which two fields are present (index.php)

  1. Select date
  2. No. of tickets

Code index.php :

    <?php

@session_start(); 
    $var_value = $_POST['eventdate'];
    $_SESSION['eventdate'] = $var_value;
    echo $_SESSION['eventdate'];
?>

<form name="_xclick" action="https://www.sandbox.paypal.com/r" method="post">
                      <table border="0" cellspacing="0" cellpadding="5" id="tbl_paypal_form">
                        <tr>
                          <td colspan="2"><div id="ticket_amount">£10 per person</div></td>
                        </tr>
                        <tr>
                          <td>Select Event Date <span class="mandatory">*</span></td>
                          <td><select name="eventdate" id="eventdate" class="form_field">
                              <option value="">Select Date</option>
                              <option value="Sat 14 July 2012">Sat 14 July 2012</option>
                              <option value="Sun 15 July 2012">Sun 15 July 2012</option>
                              <option value="Mon 16 July 2012">Mon 16 July 2012</option>
                            </select></td>
                        </tr>
                        <tr>
                          <td>No. of Tickets <span class="mandatory">*</span></td>
                          <td><input type="text" name="quantity" id="quantity" class="form_field">
                          <span style="color:#bbb; font-size:11px; padding-top:5px;">For ex: 4</span>
                          </td>
                        </tr>
                        <tr>
                          <td colspan="2"><?php
                                if(!empty($errorMessage)) 
                                {
                                    echo("<div id='validation_error'>");
                                    echo("<p class='error_message'>There was an error with your form:</p>\n");
                                    echo("<ul class='error_message'>" . $errorMessage . "</ul>\n");
                                    echo("</div>");
                                }
                            ?></td>
                        </tr>
                        <tr>
                          <td><img src="images/paypal.gif" /></td>
                          <td><input type="image" src="images/btn_paypal.gif" border="0" name="formsubmit" value="Submit" onclick="return ValidateForm();" alt="Make payments with PayPal - it's fast, free and secure!">                              
                          </td>
                        </tr>
                      </table>
                      <input type="hidden" name="cmd" value="_xclick">
                      <input type="hidden" name="business" value="gala@iskconcoventry.com">
                      <input type="hidden" name="currency_code" value="EUR">
                      <input type="hidden" name="item_name" value="Gala Charity Show Tickets">
                      <input type="hidden" name="amount" value="10">
                      <input type="hidden" name="return" value="http://www.vyx.com/gala/thankyou.php">
                      <input type="hidden" name="notify_url" value="http://www.xyx.com/gala/thankyou.php">
                      <input type="hidden" name="cbt" value="Return to The Store">
                      <!--<input type="hidden" name="eventdate" value="<?php echo $_POST['eventdate'];?>">-->
                    </form>

Code: thankyou.php

<?php

session_start();
$ticketdate = $_SESSION['eventdate'];
//echo $_SESSION['eventdate'];
echo $ticketdate;
?>

<pre style="background:#fff;">
<?php print_r($_POST);?>
</pre>

<?php


if($_POST['txn_id'] != "") 
{
    $mail_subject='Ticket Booked for Gala Charity event';
    $mail_body.= 'Hello Dear, <br><br>';
    $mail_body.= 'Below are the ticket booking details for Gala Charity event. <br><br>';
    $mail_body.= '<b>Booking Date : </b>'. $ticketdate .'<br><br>';
    //$mail_body.= '<b>Booking Date : </b>'.trim($_POST['eventdate']).'<br><br>';
    $mail_body.= '<b>Number of tickets buyed : </b>'.trim($_POST['quantity']).'<br><br>';

    $mail_body.= '<b>Transaction ID : </b>'.trim($_POST['txn_id']).'<br><br>';
    $mail_body.= '<b>First Name : </b>'.trim($_POST['first_name']).'<br><br>';
    $mail_body.= '<b>Last Name : </b>'.trim($_POST['last_name']).'<br><br>';
    $mail_body.= '<b>Payers Email  : </b>'.trim($_POST['payer_email']).'<br><br>';
    $mail_body.= '<b>Payment Date : </b>'.trim($_POST['payment_date']).'<br><br>';

    $mail_body.= '<b>Address Name : </b>'.trim($_POST['address_name']).'<br><br>';
    $mail_body.= '<b>Street : </b>'.trim($_POST['address_street']).'<br><br>';
    $mail_body.= '<b>Zip : </b>'.trim($_POST['address_zip']).'<br><br>';
    $mail_body.= '<b>State : </b>'.trim($_POST['address_state']).'<br><br>';
    $mail_body.= '<b>Country Code : </b>'.trim($_POST['address_country_code']).'<br><br>';


    $mail_body.= '<b>Item Name : </b>'.trim($_POST['item_name']).'<br><br>';
    $mail_body.= '<b>Total Amount Paid : </b>'.trim($_POST['mc_currency']).'&nbsp;'.trim($_POST['mc_gross']).'<br><br>';

    $mail_from=$_POST['payer_email'];
    $mail_to = "myname@example.com";

    //$mail_reply_to = $mail_from;
    $mail_headers = "Content-Type: text/html; charset=iso-8859-1\r\nFrom: $mail_from\r\nReply-to: $mail_reply_to\r\n";
    @mail($mail_to, $mail_subject, $mail_body, $mail_headers);

}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:08:06+00:00Added an answer on June 6, 2026 at 3:08 pm

    You should use paypal’s custom data field to send and receive additional values on payments. Simply add another input to your form

    <input name="custom" type="hidden" value="" />
    

    If you need to send two or more values you can join them with a separator like | then process them when you get them back from paypal.

    EDIT

    Change your form to

    <form name="_xclick" action="https://www.sandbox.paypal.com/r" method="post" onsubmit="buildCustomVar()">
    

    Add a little javascript to your page before the closing </body> tag

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        function buildCustomVar()
        {
            var custom = $('select[name="eventdate"]').val() + "|" + $('input[name="quantity"]').val();
            $('input[name="custom"]').val(custom);
        }
    </script>
    

    On the server side just simply explode the value you get

    $temp = explode("|", $_POST['custom']);
    $date = $temp[0];
    $quantity = $temp[1];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still beginner in PHP. I have a small problem, I would to multiply
(R beginner here...) I have a dataset like: > head(q) Date Time System User
Total beginner with PHP: I have an form based on table data that the
another beginner problem. Why isn't the following code with an asp.net page not working?
Beginner iOS dev here. I have a problem in my array. Im making an
Beginner in Android development. My code crashes. I have made a simple Java method
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
Beginner help needed :) I am doign an example form a php book which
Beginner question: I have a dictionary where the values are lists of (a variable
Absolute beginner question: I have a template file index.html that looks like this: ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.