Issues (393)

web/public/inbox/markasread.php (1 issue)

1
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/config.inc.php"); ?>
2
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/db_helper.php"); ?>
3
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/time_manip.php"); ?>
4
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?>
5
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?>
6
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_updater.php"); ?>
7
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_update.php"); ?><?php $__video_h = new video_helper($__db); ?>
8
<?php $__video_u = new video_updater($__db); ?>
9
<?php $__user_h = new user_helper($__db); ?>
10
<?php $__user_u = new user_update($__db); ?>
11
<?php $__db_h = new db_helper(); ?>
12
<?php $__time_h = new time_helper(); ?>
13
<?php
14
    if(!isset($_SESSION['siteusername'])) { die(); }
15
    $request = (object) [
16
        "username" => $_SESSION['siteusername'],
17
18
        "error" => (object) [
19
            "message" => "",
20
            "status" => "OK"
21
        ]
22
    ]; 
23
24
    $stmt = $__db->prepare("UPDATE pms SET readed = 'n' WHERE touser = :username");
25
    $stmt->execute(array(
26
        ':username' => $request->username,
27
    ));
28
29
    header('Location: ' . $_SERVER['HTTP_REFERER']);
30
31
    //echo json_encode($request, JSON_PRETTY_PRINT);
32
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...