How to put the time and date on a logout PHP script -
i'm wondering if there's way of putting date , time on php script when user logs out, displays along lines of you logged out on 19/04/2016 @ 11:00am
. php
script have
<?php // include function files application require_once('bookmark_fns.php'); session_start(); $old_user = $_session['valid_user']; // store test if *were* logged in unset($_session['valid_user']); $result_dest = session_destroy(); // start output html do_html_header('logging out'); if (!empty($old_user)) { if ($result_dest) { // if logged in , logged out echo 'logged out.<br />'; do_html_url('login.php', 'login'); } else { // logged in , not logged out echo 'could not log out.<br />'; } } else { // if weren't logged in came page somehow echo 'you not logged in, , have not been logged out.<br />'; do_html_url('login.php', 'login'); } do_html_footer(); ?>
with date function it's easy :
$date = date("d/m/y"); $time = date("h:ia"); echo "you logged out on $date @ $time"; // return logged out on 19/04/2016 @ 02:59am
Comments
Post a Comment