-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdatedms.php
27 lines (25 loc) · 961 Bytes
/
updatedms.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// Initialize the session
session_start();
//echo "qwerty";
// Check if the user is already logged in, if yes then redirect him to welcome page
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
require_once "config.php";
if($_SERVER["REQUEST_METHOD"] == "POST"){
if (isset($_POST["u"])){
$u = intval($_POST["u"]);
}
$tid = mysqli_fetch_row(mysqli_query($link,"SELECT id FROM dmreadtimes ORDER BY ID DESC LIMIT 1"))[0];
$qry = 'UPDATE dmreadtimes SET lastid='.$tid.' WHERE u1 = '.$_SESSION["id"].' and u2 = '.$u.';';
// echo $qry;
// no u
$disposeofmeimuseless = mysqli_query($link,$qry);
// $result = mysqli_query($link,'INSERT INTO messages(username,message) VALUES ('.$_SESSION["username"].'$_POST["msg"])');
// echo $_SESSION["username"].$_POST["msg"];
// echo "yay";
// }
// } else {
// echo "spam";
}
}
?>