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 7814831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:19:29+00:00 2026-06-02T05:19:29+00:00

So this has been bugging me for sometime, I want to pass a calculation

  • 0

So this has been bugging me for sometime, I want to pass a calculation which I have stored in a function onto another page, I can pass field entries no problem (sorry im newish at PHP) but how do i pass my calculation from:

// calculation section (calculator.php) – this is a include on every page
The calculation is made by a users entries which is in a include on every page

// The thank-you.php page outputs a thank you comment and sends the email
I receive all the other info fine but the function won’t come through in my email.
The output from the calculation is also stored in calculator.php which is the include but it outputs to the screen fine just not to my email :(.

Am I missing something?

Sorry (edit) here is my code:

<?php
error_reporting(E_ALL);


if(isset($_POST['name']) && isset($_POST['to'])){

ini_set('date.timezone', 'Europe/Madrid');
$now = date("H:i");

$cutoff = "06:00";
$higherthan = "22:00";


    $name = $_REQUEST['name'];
$telephone = $_REQUEST['telephone'];
$from = $_REQUEST['from'];
$to = $_REQUEST['to'];
$date = $_REQUEST['date'];
$returndate = $_REQUEST['returndate'];
$people = $_REQUEST['people'];
$return = $_REQUEST['return'];
$myemail = $_REQUEST['myemail'];

include_once('includes/config.php');

$settingsSql = mysql_query("SELECT * FROM transfers_in WHERE location='$to' AND no_passengers='$people'");
$settings        = mysql_fetch_assoc($settingsSql);

echo "From: ".$from." To: ".$settings['location']."<br />";
echo "Number of passengers: ".$settings['no_passengers']."<br />";

ini_set('date.timezone', 'Europe/Madrid');
$now = date("H:i");

$cutoff = "06:00";
$higherthan = "22:00";

echo "Time cost: ".$settings['price']." euros<br /><hr />Total: ";



    function timeCost() {

        $to = $_REQUEST['to'];
        $people = $_REQUEST['people'];
        $return = $_REQUEST['return'];

        include_once('includes/config.php');

        $settingsSql = mysql_query("SELECT * FROM transfers_in WHERE location='$to' AND no_passengers='$people'");
        $settings        = mysql_fetch_assoc($settingsSql);

        //echo $return;

        if ($return == "No"){
            if ((strtotime($now) < strtotime($cutoff)) || (strtotime($now) > strtotime($higherthan))){
                echo number_format($settings['price']) + 1.40;
            } else {
                echo number_format($settings['price']) + 0.00;
            }
        } elseif ($return == "Yes") {
            if ((strtotime($now) < strtotime($cutoff)) || (strtotime($now) > strtotime($higherthan))){
                echo number_format($settings['price']) * 2 + 1.40;
            } else {
                echo number_format($settings['price']) * 2 + 0.00;
            }
        }

        echo " in euros<br /><br />";   
    }

    echo timeCost();


} else { ?>

<form method="POST" action="thank-you.php" name="chooseDateForm" id="chooseDateForm">
            <label>Name:</label>
            <input type="text" value="" name="name" />

            <label>Telephone:</label>
            <input type="text" value="" name="telephone" />

            <label>Email:</label>
            <input type="text" value="" name="myemail" />

            <label>From:</label>
            <select name="from">
                <option selected="selected">Malaga</option>
            </select>
            <div class="clr"></div>

            <label>To:</label>
            <select name="to">

<?php foreach ($data as $place => $price){
    echo "<option>{$place}</option>\n";
}
echo '</select>
            <div class="clr"></div>

            <label>Date:</label>
            <input type="text" value="dd/mm/yyyy" id="date" name="date" class="date-pick" />
            <span id="calendar"></span>

            <div id="return-journey">
                <label>Return Date:</label>
                <input type="text" value="dd/mm/yyyy" id="returndate" name="returndate" class="date-pick" />
                <span id="calendar"></span>
            </div>

            <label>Number of people:</label>
            <select id="people" name="people">
                <option value="4">4</option>
                <option value="6">6</option>
                <option value="8">8</option>
            </select>
            <div class="clr"></div>

            <div id="return">
                <label>Is this a return<br />journey?</label>
                <div class="clr"></div>
                <div id="radio-buttons">
                    <input type="radio" name="return" value="Yes" class="radio returning" />Yes<br />
                    <input type="radio" name="return" value="No" class="radio" checked />No
                </div>
            </div>
            <div class="clr"></div>

            <input type="submit" name="submit" class="fauxButton" />            

        </form>';
}
?>
  • 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-02T05:19:31+00:00Added an answer on June 2, 2026 at 5:19 am

    If you are using sessions, you can store the variable, results, array — whatever into a session variable and then retrieve it on a new page.

    session_start();
    $_SESSION['test_var'] = 'Jake';
    

    Then when I navigate to a new page and retrieve the var:

        session_start();
    echo $_SESSION['test_var'] 
        // outputs 'Jake'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a question regarding something which has been bugging me for some time now.I'm
This has been bugging me lately. Say I have a base class Base. If
This has been bugging me for quite some time now. All I want to
This is something which has been bugging me. If I create a SoundEffectInstance via
This has been bugging me for a while and have yet to find an
This has been bugging me for a while. I have this ircbot that I
I have a strange issue which has been bugging me all day. On the
This has been bugging me for a few days now and I have not
This question has been bugging me for some time. I always picture launching my
This question has been bugging me for some time. I've already developed a couple

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.