HELP with website error

Hello,

The website I am practicing on at the moment is www.immystudios.com I am new to php and mysql

I get this error, and I do not know why on my live site…but it works perfectly fine on my local host

Fatal error: require_once(): Failed opening required '\..\dbconnect.php' (include_path='.:/usr/lib/php7.0') in /homepages/40/d666957300/htdocs/Student/includes/nav.php on line 8

This is my nav file

<ul>
	 <?php 

	ob_start();
	session_start();
	require_once '\..\dbconnect.php';

	 // if the user is not logged in display this
     if( !isset($_SESSION['user']) ) {
	 	foreach($notLoggedIn as $item)//navItems
	 	{
	 		echo "<li><a href=\"$item[slug]\">$item[title]</a></li>";
	 		
	 	}
	 }

	 //If the user is logged in do this!
	 else
	 {
	 	foreach($loggedIn as $item)
	 	{
	 		echo "<li><a href=\"$item[slug]\">$item[title]</a></li>";
	 		
	 	}
	 }
	 
	  ?>
</ul>

Can anyone help me? You can also go to www.immystudios.com to see the error first hand

Make the slashes go the other way.

require_once ‘/…/dbconnect.php’;

Thanks for the response, but unfortunately that did not solve the problem. I am still getting the same error

What is your file/folder structure including where you have the db connect file? Is your server windows or Linux?

Oh I figured it out, it works when I do this for some reason, although the dbconnect is not in the same place as my nav.php

my nav.php is in student/includes/nav.php

and my dbconnect.php is in student/dbconnect.php

require_once 'dbconnect.php';
Sponsor our Newsletter | Privacy Policy | Terms of Service