This is PHP Using cookies – can you add to the “You have logged on” line above to state (on the next line); “Your last l
Posted: Thu Jul 14, 2022 2:06 pm
This is PHP
Using cookies – can you add to the “You have logged on” lineabove to state (on the next line); “Your last login was: “ withdate and time.
If I want to add my last login's data and time, whichcode should I have to use?
(After print '<p>You have logged at:<b>'~)
<?php //Obtain Session Information session_start(); //This is the specials file define('TITLE', 'Our Menu'); //Include the header.html template include('templates/header.html'); ?> <h1>Pizza Menu</h1><?php //Set timezone date_default_timezone_set('America/Toronto'); print '<p><b>Hello, ' .$_SESSION['email'] . '!</b></p>'; print '<p>You have logged at: <b>' .date('g:i a', $_SESSION['loggedin']) .'</b></p>';?> <p>Choose from our outstanding menubelow!</p> <table> <tr><td> <h3>Alternative Meat Pizza - $14.99</h3> <ul> <b>Toppingsincluded:</b> <li>Elk</li> <li>Alligator</li> <li>Snake</li> <li>Boar Bacon</li> </ul> </td><td> <imgsrc="images/alternative_pizza.png" alt="" /> </td></tr> <tr><td> <h3>Fruitarian Pizza - $24.99</h3> <ul> <b>Toppingsincluded:</b> <li>Bananas</li> <li>Kiwi</li> <li>Blueberries</li> <li>Strawberries</li> </ul> </td><td> <imgsrc="images/fruit_pizza.png" alt="" /> </td></tr> </table><?php //Logout link print '<p><ahref="logout.php">Logout</a></p>'; //Include the footer.html template include('templates/footer.html');?>
Using cookies – can you add to the “You have logged on” lineabove to state (on the next line); “Your last login was: “ withdate and time.
If I want to add my last login's data and time, whichcode should I have to use?
(After print '<p>You have logged at:<b>'~)
<?php //Obtain Session Information session_start(); //This is the specials file define('TITLE', 'Our Menu'); //Include the header.html template include('templates/header.html'); ?> <h1>Pizza Menu</h1><?php //Set timezone date_default_timezone_set('America/Toronto'); print '<p><b>Hello, ' .$_SESSION['email'] . '!</b></p>'; print '<p>You have logged at: <b>' .date('g:i a', $_SESSION['loggedin']) .'</b></p>';?> <p>Choose from our outstanding menubelow!</p> <table> <tr><td> <h3>Alternative Meat Pizza - $14.99</h3> <ul> <b>Toppingsincluded:</b> <li>Elk</li> <li>Alligator</li> <li>Snake</li> <li>Boar Bacon</li> </ul> </td><td> <imgsrc="images/alternative_pizza.png" alt="" /> </td></tr> <tr><td> <h3>Fruitarian Pizza - $24.99</h3> <ul> <b>Toppingsincluded:</b> <li>Bananas</li> <li>Kiwi</li> <li>Blueberries</li> <li>Strawberries</li> </ul> </td><td> <imgsrc="images/fruit_pizza.png" alt="" /> </td></tr> </table><?php //Logout link print '<p><ahref="logout.php">Logout</a></p>'; //Include the footer.html template include('templates/footer.html');?>