i’m getting a blank page on logging in to my dashboard home.php, it’s only displaying white blank page while the url is showing i’m logged in

Blank dashboard page on multi user login form for 3 users but when a user login on the live server the dashboard page goes blank even though the url is showing that the user is logged in but the page will be total white blank page. Everything is working fine in the local server but having this issue on the live server

here is the dashboard page

home.php

    <?php
        session_start();
        include 'config.php';`

        if (!isset($_SESSION['username']) || !isset($_SESSION['id']) || $_SESSION['subscribed'] ===   false) {
        header("Location: unsubscribed.php");
        exit();
        }

        // Fetch unread notification count
        $customer_id = $_SESSION['id'];
        $stmt = $conn->prepare("SELECT COUNT(*) AS unread_count FROM customer_notifications WHERE      customer_id = ? AND is_read = 0");
        $stmt->bind_param("i", $customer_id);
        $stmt->execute();
        $stmt->bind_result($unread_count);
        $stmt->fetch();
        $stmt->close();

        if (!isset($unread_count)) {
        $unread_count = 0;
        }
    ?>

footer.php

<script>
    document.addEventListener("DOMContentLoaded", function() {
        var notificationDropdown = document.getElementById('notificationDropdown');
        if (notificationDropdown) {
            notificationDropdown.addEventListener('click', function() {
            // AJAX call to fetch notifications
            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'fetch_notifications.php', true);
            xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhr.onload = function() {
                if (this.status == 200) {
                    document.getElementById('notificationsList').innerHTML = this.responseText;
                }
            };
            xhr.send();

            // AJAX call to mark notifications as read
            var xhrRead = new XMLHttpRequest();
            xhrRead.open('POST', 'mark_notifications_read.php', true);
            xhrRead.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhrRead.send();

            // Optionally, update the UI by hiding the badge
            var notificationBadge = document.getElementById('notificationBadge');
            if (notificationBadge) {
                notificationBadge.style.display = 'none';
            }
        });
    }
});

</script>

login.php is the user login page

    <?php
        session_start();

        error_reporting(E_ALL);
        ini_set('display_errors', 1);

        include "./config.php";

        date_default_timezone_set('Africa/Lagos'); // Set PHP timezone to Nigeria

        $conn->query("SET time_zone = '+01:00'"); // Set MySQL timezone to Nigeria

        $msg = "";
        $error = "";

        if (isset($_POST['login-btn'])) {
            $username = mysqli_real_escape_string($conn, $_POST['username']);
            $password = $_POST['password'];
            $usertype = mysqli_real_escape_string($conn, $_POST['usertype']);

            if (!empty($username) && !empty($password) && !empty($usertype) && $usertype !== "Select User") {
                $sql = "SELECT * FROM users WHERE username=? AND usertype=? LIMIT 1";
                $stmt = $conn->prepare($sql);
                $stmt->bind_param("ss", $username, $usertype);
                $stmt->execute();
                $result = $stmt->get_result();
                $row = $result->fetch_assoc();

                if ($result->num_rows == 1 && password_verify($password, $row['password'])) {
                    if ($row['unsubscribed'] == 1) {
                        header("Location: de-activated.php");
                        exit();
                    }

                    session_regenerate_id();
                    $_SESSION['id'] = $row['uid'];
                    $_SESSION['username'] = $row['username'];
                    $_SESSION['photo'] = $row['photo'];
                    $_SESSION['role'] = $row['usertype'];
                    $_SESSION['subscription_end'] = $row['subscription_end'];

                     // Update last_login timestamp
                    $lastLogin = date('Y-m-d H:i:s');
                    $updateLoginSql = "UPDATE users SET last_login = ? WHERE uid = ?";
                    $updateLoginStmt = $conn->prepare($updateLoginSql);
                    $updateLoginStmt->bind_param("si", $lastLogin, $row['uid']);
                    $updateLoginStmt->execute();

                    // Store last_login in session
                    $_SESSION['last_login'] = $lastLogin;

                    // Check if the user has a valid subscription
                    $current_date = new DateTime();
                    $subscription_end = null;
                    $subscription_status = 'unsubscribed';
                    $_SESSION['subscribed'] = false;

                    if ($row['subscription_end'] !== null) {
                        $subscription_end = new DateTime($row['subscription_end']);
                    }

                    if (!empty($row['subscription_type']) && !empty($row['subscription_start']) && $subscription_end !== null && $subscription_end >= $current_date) {
                        $subscription_status = 'subscribed';
                        $_SESSION['subscribed'] = true;
                    }

                    // Update the subscription status in the database
                    $update_sql = "UPDATE users SET subscription_status=? WHERE uid=?";
                    $update_stmt = $conn->prepare($update_sql);
                    $update_stmt->bind_param("si", $subscription_status, $_SESSION['id']);
                    $update_stmt->execute();

                    // Redirect based on subscription status
                    if ($_SESSION['subscribed'] === false) {
                        if ($_SESSION['role'] == "Customer") {
                            header("Location: customer/unsubscribed.php");
                        } elseif ($_SESSION['role'] == "Mechanic") {
                            header("Location: mechanic/unsubscribed.php");
                        } elseif ($_SESSION['role'] == "Partseller") {
                            header("Location: partseller/unsubscribed.php");
                        }
                        exit();
                    } else {
                        if ($_SESSION['role'] == "Customer") {
                            header("Location: customer/home.php");
                        } elseif ($_SESSION['role'] == "Mechanic") {
                            header("Location: mechanic/home.php");
                        } elseif ($_SESSION['role'] == "Partseller") {
                            header("Location: partseller/home.php");
                        }
                         exit();
                    }
                } else {
                    echo "Username or Password is incorrect";
                }
            } else {
                echo "Please fill all forms correctly";
            }
        }
    ?>

Here is the connection file

config.php

<?php

    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

    // Define server variables
    $servername = "localhost:";
    $username   = "myusername";
    $password   = "mypassword";
    $dbname     = "mydatabase";

    // Create connection
    $conn = mysqli_connect($servername, $username, $password, $dbname);

    //Check connection
    if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
?>

i don’t really know where error is coming from, please can someone help me out.

6

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

i’m getting a blank page on logging in to my dashboard home.php, it’s only displaying white blank page while the url is showing i’m logged in

Blank dashboard page on multi user login form for 3 users but when a user login on the live server the dashboard page goes blank even though the url is showing that the user is logged in but the page will be total white blank page. Everything is working fine in the local server but having this issue on the live server

here is the dashboard page

home.php

    <?php
        session_start();
        include 'config.php';`

        if (!isset($_SESSION['username']) || !isset($_SESSION['id']) || $_SESSION['subscribed'] ===   false) {
        header("Location: unsubscribed.php");
        exit();
        }

        // Fetch unread notification count
        $customer_id = $_SESSION['id'];
        $stmt = $conn->prepare("SELECT COUNT(*) AS unread_count FROM customer_notifications WHERE      customer_id = ? AND is_read = 0");
        $stmt->bind_param("i", $customer_id);
        $stmt->execute();
        $stmt->bind_result($unread_count);
        $stmt->fetch();
        $stmt->close();

        if (!isset($unread_count)) {
        $unread_count = 0;
        }
    ?>

footer.php

<script>
    document.addEventListener("DOMContentLoaded", function() {
        var notificationDropdown = document.getElementById('notificationDropdown');
        if (notificationDropdown) {
            notificationDropdown.addEventListener('click', function() {
            // AJAX call to fetch notifications
            var xhr = new XMLHttpRequest();
            xhr.open('POST', 'fetch_notifications.php', true);
            xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhr.onload = function() {
                if (this.status == 200) {
                    document.getElementById('notificationsList').innerHTML = this.responseText;
                }
            };
            xhr.send();

            // AJAX call to mark notifications as read
            var xhrRead = new XMLHttpRequest();
            xhrRead.open('POST', 'mark_notifications_read.php', true);
            xhrRead.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
            xhrRead.send();

            // Optionally, update the UI by hiding the badge
            var notificationBadge = document.getElementById('notificationBadge');
            if (notificationBadge) {
                notificationBadge.style.display = 'none';
            }
        });
    }
});

</script>

login.php is the user login page

    <?php
        session_start();

        error_reporting(E_ALL);
        ini_set('display_errors', 1);

        include "./config.php";

        date_default_timezone_set('Africa/Lagos'); // Set PHP timezone to Nigeria

        $conn->query("SET time_zone = '+01:00'"); // Set MySQL timezone to Nigeria

        $msg = "";
        $error = "";

        if (isset($_POST['login-btn'])) {
            $username = mysqli_real_escape_string($conn, $_POST['username']);
            $password = $_POST['password'];
            $usertype = mysqli_real_escape_string($conn, $_POST['usertype']);

            if (!empty($username) && !empty($password) && !empty($usertype) && $usertype !== "Select User") {
                $sql = "SELECT * FROM users WHERE username=? AND usertype=? LIMIT 1";
                $stmt = $conn->prepare($sql);
                $stmt->bind_param("ss", $username, $usertype);
                $stmt->execute();
                $result = $stmt->get_result();
                $row = $result->fetch_assoc();

                if ($result->num_rows == 1 && password_verify($password, $row['password'])) {
                    if ($row['unsubscribed'] == 1) {
                        header("Location: de-activated.php");
                        exit();
                    }

                    session_regenerate_id();
                    $_SESSION['id'] = $row['uid'];
                    $_SESSION['username'] = $row['username'];
                    $_SESSION['photo'] = $row['photo'];
                    $_SESSION['role'] = $row['usertype'];
                    $_SESSION['subscription_end'] = $row['subscription_end'];

                     // Update last_login timestamp
                    $lastLogin = date('Y-m-d H:i:s');
                    $updateLoginSql = "UPDATE users SET last_login = ? WHERE uid = ?";
                    $updateLoginStmt = $conn->prepare($updateLoginSql);
                    $updateLoginStmt->bind_param("si", $lastLogin, $row['uid']);
                    $updateLoginStmt->execute();

                    // Store last_login in session
                    $_SESSION['last_login'] = $lastLogin;

                    // Check if the user has a valid subscription
                    $current_date = new DateTime();
                    $subscription_end = null;
                    $subscription_status = 'unsubscribed';
                    $_SESSION['subscribed'] = false;

                    if ($row['subscription_end'] !== null) {
                        $subscription_end = new DateTime($row['subscription_end']);
                    }

                    if (!empty($row['subscription_type']) && !empty($row['subscription_start']) && $subscription_end !== null && $subscription_end >= $current_date) {
                        $subscription_status = 'subscribed';
                        $_SESSION['subscribed'] = true;
                    }

                    // Update the subscription status in the database
                    $update_sql = "UPDATE users SET subscription_status=? WHERE uid=?";
                    $update_stmt = $conn->prepare($update_sql);
                    $update_stmt->bind_param("si", $subscription_status, $_SESSION['id']);
                    $update_stmt->execute();

                    // Redirect based on subscription status
                    if ($_SESSION['subscribed'] === false) {
                        if ($_SESSION['role'] == "Customer") {
                            header("Location: customer/unsubscribed.php");
                        } elseif ($_SESSION['role'] == "Mechanic") {
                            header("Location: mechanic/unsubscribed.php");
                        } elseif ($_SESSION['role'] == "Partseller") {
                            header("Location: partseller/unsubscribed.php");
                        }
                        exit();
                    } else {
                        if ($_SESSION['role'] == "Customer") {
                            header("Location: customer/home.php");
                        } elseif ($_SESSION['role'] == "Mechanic") {
                            header("Location: mechanic/home.php");
                        } elseif ($_SESSION['role'] == "Partseller") {
                            header("Location: partseller/home.php");
                        }
                         exit();
                    }
                } else {
                    echo "Username or Password is incorrect";
                }
            } else {
                echo "Please fill all forms correctly";
            }
        }
    ?>

Here is the connection file

config.php

<?php

    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);

    // Define server variables
    $servername = "localhost:";
    $username   = "myusername";
    $password   = "mypassword";
    $dbname     = "mydatabase";

    // Create connection
    $conn = mysqli_connect($servername, $username, $password, $dbname);

    //Check connection
    if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
?>

i don’t really know where error is coming from, please can someone help me out.

6

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật