0

I am trying to help someone with their php website that renders a blank page. When I troubleshoot, I comment out code below and then the page works.

// include "checkifuserlogin.php";
// $condition = "";   
// $objDreamVacationGallery = new HomePageBanner();
// $data = $objDreamVacationGallery->selectAllRecords($condition,       $sort_field, $sort_order, $start, $limit);

I assume this is a database error but I cannot find where the config file is to see where the database is stored, if its locally or remote.

The server is linux box in AWS.

Checkifuserlogin.php has

<?php
if( (isset($_SESSION['userid']) &&  $_SESSION['userid'] != '') && (isset($_SESSION['firsttimelogin']) && $_SESSION['firsttimelogin']=='0') ){
    if($_REQUEST["from"]=="contactus") {
        echo "<script language='JavaScript'>window.location = 'my-account.php'; </script>";
    } else {
        echo "<script language='JavaScript'>window.location = 'page.php?page_id=home'; </script>";
    }
    exit;
}

selectAllRecords:

public function selectAllRecords($condition='', $sort_field='', $sort_order='', $limit_start='', $limit_end=''){
    return parent::select($this->db_table, $condition, $sort_field, $sort_order, $limit_start, $limit_end);
}

?>
DavidJS
  • 417
  • 2
  • 5
  • 16
  • Lots of questions - What does checkifuserlogin.php include? What does the class HomePageBanner have in it? What's the code behind selectAllRecords? – Adam May 09 '18 at 18:05
  • I will put it above – DavidJS May 09 '18 at 18:06
  • It's rendering blank likely due to $_REQUEST (bad idea - https://stackoverflow.com/questions/2142497/whats-wrong-with-using-request) not being set as you're killing the execution via exit; – Adam May 09 '18 at 18:08
  • Check the server error logs, it will give you information as to what's going on. – aynber May 09 '18 at 18:15
  • In linux where do I check server logs? – DavidJS May 09 '18 at 18:16
  • If you have access to the full server, it's usually in a subdirectory for `/var/log/`, usually apache2, httpd, or nginx. – aynber May 09 '18 at 18:22

0 Answers0