Login System: Notice: Undefined variable: db in headers.php

Posted in CategoryGeneral Discussion
  • Terry Ogbemudia 1 month ago
    We use try catch block in the course, continue watching 
  • MOHAMED ARIFIN 1 month ago

    I want the error to be displayed without showing the file directory in the server when not connected to database.

  • Terry Ogbemudia 1 month ago
    Hi Arifin, what are you trying to achieve? you don't have access to a database? 
  • MOHAMED ARIFIN 1 month ago

    I have make some changes to make it work but fail.

    <?php
    include_once 'resource/session.php';
    include_once 'resource/Database.php';
    include_once 'resource/utilities.php';

    $check_db = isset($db);
    ?>

    <?php if ((isset($_SESSION['username']) || isCookieValid($check_db))) : ?>

    How would you do solve it??


  • MOHAMED ARIFIN 1 month ago

    Hi Terry,

    When i was try open site Login System without database server, the error message "connection failed" not showing.

    The header.php have include_once resource/Database.php.

    What should i do?

Please login or register to leave a response.