Jump to content

Peculiar issue with include


swatisonee

Recommended Posts

Hi:

 

1.I have some scripts in  a dir of my root directory that i wanted to move to a subdir in it .

 

2.So i created a dir "Set1" and moved them there.

 

3.Now each of these files has an include at the top which contains db info and another which contains session info etc).

 

4.After redirecting to the new location I modified the include as under and got errors - as listed below.

 

5.It appears that when a script in the new location is to be processed, it cannot find the db info.

 

6.It searches for the db info in the subdir and not in the main dir.

 

I tried fiddling with the ../ stuff but havent succeeded. Any pointers please ?

 

Many thanks:Swati

=========================

 

/www/NEW contains

 

connectionlink.php

loglink.php

 

 

/www/NEW/Set1 contains

 

hr.php

 

The header of hr.php is as under :

 

<?
header("Cache-Control: public");

include ("../NEW/connectionlink.php"); //db info 
include ("../NEW/loglink.php"); //loginfo

?>

 

Errors that come up are as under.  Lines 5, 6 of hr.php have the include statements:

 

Warning: include(../NEW/connectionlink.php) [function.include]: failed to open stream: No such file or directory in /home/tern/public_html/NEW/Set1/hr.php on line 5

Warning: include(../NEW/connectionlink.php) [function.include]: failed to open stream: No such file or directory in /home/tern/public_html/NEW/Set1/hr.php on line 5

Warning: include() [function.include]: Failed opening '../NEW/connectionlink.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tern/public_html/NEW/Set1/hr.php on line 5

Warning: include(../NEW/loglink.php) [function.include]: failed to open stream: No such file or directory in /home/tern/public_html/NEW/Set1/hr.php on line 6

Warning: include(../NEW/loglink.php) [function.include]: failed to open stream: No such file or directory in /home/tern/public_html/NEW/Set1/hr.php  on line 6

Warning: include() [function.include]: Failed opening '../NEW/loglink.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/tern/public_html/NEW/Set1/hr.php on line 6
Sorry, Please login and use this page 

Link to comment
https://forums.phpfreaks.com/topic/219780-peculiar-issue-with-include/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.