I have the following codes:
$n = $totalMins/60;
$whole = floor($n);
$fraction = $n - $whole;
$totalHrs += $whole;
$totalMins = round($fraction*60);
$total = "$totalHrs hours and $totalMins mins";
$totalDeci = round($fraction, 2);
$totalDeci += $totalHrs;
$totalDeci = number_format($totalDeci, 2);
I want the $totalDeci to be called on another php page that I have. Is there a way for me to call it? I'm not really familiar with php.
Use session variables.
Page1.php:
<?php
session_start();
$_SESSION['your_variable'] = 'your_value';
?>
Page2.php:
<?php
session_start();
echo $_SESSION['your_variable'];
?>
Page2.php will show: your_value
Hope it will help you :)
Use session as above example or use query string
index.php?id=101
$user_id=$_GET['id'];
echo "$user_id";