• Ogłoszenie:

How can i log user's logout time?

Wszystko odnośnie tworzenia grafiki - obróbka, problemy, oceny.
Tworzenia Stron internetowych - HTML, PHP, MySQL...

How can i log user's logout time?

Postprzez TorhanPiper 10 Maj 2023, 07:00

reklama
Hi everyone, I'm currently working on a school website and I need assistance with logging a user's logout time in my database. Here's the code I've written so far (please forgive any indentation errors, as I'm using a mobile device):

(Note: The column in the database is named "LOdatetime" and the table is named "Users")

<?php
session_start();
$con = mysqli_connect(SERVER, USER, PASSWORD, DATABASE);
$LOdatetime = date("Y-m-d h:i:s");
$query = "UPDATE Users SET LOdatetime='$LOdatetime' WHERE Email='$Email';";
$result = mysqli_query($con, $query);
session_destroy();
header("location:../index.php");
exit();
?>
Could you please advise me on how to correct my code so that I can successfully log the user's logout times in the database table? Thank you in advance!
TorhanPiper
~user
 
Posty: 9
Dołączenie: 04 Maj 2023, 09:44



Powróć do Grafika & Webmastering

Kto jest na forum

Użytkownicy przeglądający to forum: Brak zarejestrowanych użytkowników oraz 12 gości