unable to move data to next page


#1

Our phone OTP (Cell Phone) is on this page (https://fleet.com.pk/booking/confirm.php) but I want to move it to a new separate page (lets say number.php), but when I do, at the end, the email does not contain details entered at confirm.php

whats wrong?

I have tried creating number.php with the following code, it sends number to mobile phone for verification but at the end, the email does not contain information entered in confirm.php
<?php
session_start();
if (!isset($_SESSION[‘authenticated’]))
{
header(‘Location:/error.php’);
exit;
}
include(“includes/config.php”);

?>

    <div class="col-lg-10 mx-auto">
     <div class="row">&nbsp;</div>
    <div class="col-lg-12 ">
        <form method="post" action="confirmCell.php">
          <div class="row">
            <div class="col-lg-12 mx-auto">
                  <div class="form-group">
                      <label for="cell">Mobile Phone</label> 
                      <input type="number" class="form-control" id="cell" name="cellPhone" required="true"> 
                  </div>
          </div>
              <div class="col-lg-6 mx-auto">
                  <button class="btn btn-primary btn-lg btn-block" id="getAll">CONFIRM BOOKING</button>
                <div class="row">&nbsp;</div>
                                  </div>
          </div>
          </form>

#2

Posted data is NOT transferred to other pages. You have to add code to do that.

You either have to save it in the $_SESSION array or send it to the next page using parameters.
To do it with sessions, you can store it like this: $_SESSION[“number”]= and then read it back in the second
page. Or you can pass it in the URL of the second page. To do that, you would have to remove the action
clause on the form and use PHP to transfer to the second page passing the data. I feel it is easier to just pass
the data using the session.

Do you understand this so far? If not, we can explain in more details…