Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat did I do wrong? Header snet ahead?
    primarykey
    data
    text
    <p>I have those tree files:</p> <p><strong>menulogged.php</strong></p> <pre><code>&lt;?php require_once('includes/helper/session.php'); require_once("includes/helper/initialize.php"); if (!$session-&gt;is_logged_in()) { Header("location:/public/userview/ctr_login.php"); } include_layout_template('admin_header.php'); ?&gt; </code></pre> <p><strong>ctr_login.php</strong></p> <pre><code>&lt;?php require_once("includes/helper/session.php"); if($session-&gt;is_logged_in()) { $mess='You are already logged in'; } ?&gt; </code></pre> <p>and <strong>session.php</strong></p> <pre><code>&lt;?php // A class to help work with Sessions // In our case, primarily to manage logging users in and out class Session { private $logged_in=false; public $user_id; public $message; function __construct() { session_start(); $this-&gt;check_message(); $this-&gt;check_login(); } public function is_logged_in() { return $this-&gt;logged_in; } public function login($user) { // database should find user based on username/password if($user){ $this-&gt;user_id = $_SESSION['user_id'] = $user-&gt;id; $this-&gt;logged_in = true; } } public function logout() { unset($_SESSION['user_id']); unset($this-&gt;user_id); $this-&gt;logged_in = false; } $session = new Session(); $message = $session-&gt;message(); ?&gt; </code></pre> <p>For some reason since I am not logged in I get to the login controller and then I get this error:</p> <pre><code>Warning: require_once(includes/helper/initialize.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/40/7141640/html/public/userview/ctr_login.php on line 2 Fatal error: require_once() [function.require]: Failed opening required 'includes/helper/initialize.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/40/7141640/html/public/userview/ctr_login.php on line 2 </code></pre> <p>I can not believe I am having so many issues with deploying the website I just made. I thought in an hour at most it would be done, but apparently only a person that never made a website would believe that. I looked at the code for at least an hour and I can't figure it out. What did I do wrong?</p> <p><strong>EDIT</strong> I noticed that no matter which two files I call, on the first file the include works fine, and on the second one it can't find the file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload