I have a form where a user enters details and results are shown on the same page. These results can then be submitted.
First_page.php
<?php
session_start();
if (isset($_POST['applySubmit'])) {
$_SESSION['amountdiv'] = $amountdiv;
$_SESSION['fixedrate'] = $fixedrate;
$_SESSION['deliverydiv'] = $deliverydiv;
$_SESSION['date'] = $date;
$_SESSION['total'] = $total;
$_SESSION['grandtotal'] = $grandtotal;
$_SESSION['reference'] = $reference;
}
?>
I've seen a lot of examples on this and I'm using this example from this post PHP Pass variable to next page . The problem I have is that on the second page, where I want to output the details, nothing is appearing.
Second_page.php
<?php
session_start();
//*************Session form details to carry through*****************//
$amountdiv = $_SESSION['amountdiv'];
$fixedrate = $_SESSION['fixedrate'];
$deliverydiv = $_SESSION['deliverydiv'];
$date = $_SESSION['date'];
$total = $_SESSION['total'];
$grandtotal = $_SESSION['grandtotal'];
$reference = $_SESSION['reference'];
?>
Then I want to echo this info out onto the screen but nothing is appearing.
<td class="blaah1"><?php echo $_SESSION['amountdiv'] ;?></td>
<td class="blaah1"><?php echo $_SESSION['grandtotal'] ;?></td>
<td class="blaah3"><?php echo $_SESSION['date'] ; ?></td>
Why isn't anything appearing?