Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to properly include file with correct path and remove warning "file not exists"
    text
    copied!<p>I am working on a project which will be connected to a MySQL database requires the following:</p> <ul> <li>Registration</li> <li>Login/Logged-in/Logout</li> <li>Home</li> <li>Links</li> </ul> <p>Two items available for those who log in:</p> <ul> <li>My Bookmarks</li> <li>Contact Us</li> </ul> <p>My current site structure is as follows:</p> <pre><code> *Shortened* URL (project root folder): sois.com/440/finalproject/ </code></pre> <ul> <li>finalproject Folder Contents: htdocs folder | mysql_connect.php</li> <li>htdocs Folder Contents: bookmark folder | contact folder | Home folder | includes folder</li> <li>bookmark Folder Contents (ALL PHP FILES): add | delete | deleteconfirm | index | search | searchform | update | updateform</li> <li>contact Folder Contents: contact.php</li> <li>Home Folder Contents (ALL PHP FILES): forgot | index | link | loggedin | login | logout | register</li> <li>includes Folder Contents: footer.php | header.php | logo.jpg</li> </ul> <p>This is an image of what you are supposed to see before LOGIN: </p> <p><img src="https://i.stack.imgur.com/bSvP3.png" alt="enter image description here"></p> <p>The code for /Home/index.php is as follows:</p> <pre><code>&lt;?php # index.php session_start(); //check session first if (!isset($_SESSION['email'])){ include ('header.php'); }else { include ('header.php'); } ?&gt; &lt;h2&gt;Project Description&lt;/h2&gt; &lt;h2&gt;Blah Blah Blah ...&lt;/h2&gt; &lt;h2&gt;put images here if you want ...&lt;/h2&gt; &lt;h2&gt;change background ...&lt;/h2&gt; &lt;h2&gt;modify the site as you want ...&lt;/h2&gt; &lt;?php include ('footer.php'); ?&gt; </code></pre> <p>My question is fairly simply, I receive the errors:</p> <ul> <li>"Warning: include(kethcart.uwmsois.com/public_html/440/finalproject/htdocs/includes/header.php): failed to open stream: No such file or directory in /home/kethcart/public_html/440/finalproject/htdocs/home/index.php on line 5"</li> <li>"Warning: include(): Failed opening 'kethcart.uwmsois.com/public_html/440/finalproject/htdocs/includes/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kethcart/public_html/440/finalproject/htdocs/home/index.php on line 5"</li> <li>"Warning: include(kethcart.uwmsois.com/public_html/440/finalproject/htdocs/includes/footer.php): failed to open stream: No such file or directory in /home/kethcart/public_html/440/finalproject/htdocs/home/index.php on line 19"</li> <li>"Warning: include(): Failed opening 'kethcart.uwmsois.com/public_html/440/finalproject/htdocs/includes/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/kethcart/public_html/440/finalproject/htdocs/home/index.php on line 19"</li> </ul> <p>Question: How can I properly link the file locations of header.php and footer.php (located in the include folder) so that my index.php (located in the Home folder) properly displays, like the above image?</p> <p>While I know there are other posts floating around StackOverflow, I failed to locate one which I fully understood and could apply to my situation. I apologize if my question seems elementary but I fully appreciate any and all help!</p> <p>Thanks everyone, if you have any further questions or need more details, let me know.</p>
 

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