I'm getting the current error and I'm not sure how to get to the file.
PHP Warning: include(./core/int.php): failed to open stream: No such file or directory in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/login/index.php on line 2
PHP Warning: include(): Failed opening './core/int.php' for inclusion (include_path='.:/usr/local/lib/php-5.3.13/lib/php') in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/login/index.php on line 2
Here is the file structure:
So if I where to type it out in the browser it would look like the following:
The text inside of the index.php file:
<p>Just a template.</p>
<?php include '../includes/overall/footer.php'; ?>
The text inside the int.php file:
I think I might have fixed the issue inside of the int.php file I needed another '.'
nope still getting the error
i think you should remove the
. in the
so there will be like this one
but you must check directory and included file permission.
According to the file structure you've outlined, it should read:
include '<font color='"#FF0000"'>..</font>/core/int.php';
with two dots. But a more reliable way to link to an include—which doesn't depend on where the files are in relation to each other—is this:
<?php include $_SERVER["DOCUMENT_ROOT"] . "/core/int.php"; ?>
... assuming that the /core/ folder is inside your root folder. If not, the path needs to be modified.
Whenever I get a "file not found error" I use the results from getcwd() and then adjust the relative path of the missing file:
echo getcwd(); die;
include './core/int.php'; # adjust path in accordance with the above results.
Start your script with the set_include_path() function => see php manual
Saves you a lot of headaches...
ralph.m - you were right I added the extra dot a I think that got it going. I'm no longer getting that error.
I tried the second option and was still stuck. I would have to start it from the sites root folder correct? Will it work even if the file calling for it is not in the root folder it's self?
After making the changes I'm now getting this:
PHP Warning: session_start(): open(/var/php_sessions/sess_7c16b0ff14a4b451578b52ed5220ffc9, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb/web078/b784/dom.3geehousemediacom/public_html/3GHM/core/int.php on line 2
This is the code:
Not sure why that is an error is am I missing so information for the session to start?
Yes it's fixed
ralph.m - thanks for that code "<?php include $SERVER["DOCUMENTROOT"] . "/core/int.php"; ?>" It helped!
Glad you've sorted it.
Yes, links like that work no matter what page there are in, anywhere in the site, which makes them a lot easier to use.
$SERVER["DOCUMENTROOT"] is very useful sometimes. I will write it in my notebook.
PHP Warning: session_start(): open(/var/php_sessions/sess_9060220c72b6226265ccfd207f2f42a4, O_RDWR) failed: No such file or directory (2) in /hermes/bosweb/web078/b784/dom.mediacom/public_html/3GHM/core/init.php on line 1
require $_SERVER["DOCUMENT_ROOT"] . "/core/database/connect.php";
require $_SERVER["DOCUMENT_ROOT"] . "/core/function/general.php";
require $_SERVER["DOCUMENT_ROOT"] . "/core/function/users.php";
$errors = array();
Is it not storing the session?
This topic is now closed. New replies are no longer allowed.