Ive proper cocked it up

mfdc's picture

They have: 160 posts

Joined: Aug 2004

Hi

I run an intranet internally on one of my networks. When you go to the internal IP address, it runs the index.htm file which calls three files. Mainmenu.htm, logo.htm & news.php.

News.php fetches information updated from an xml file and displays it in a central column within index.htm

All I was doing was changing some colours & know when I go to the IP address I get this error

Warning: Failed opening 'inc/displayposts.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/content.php on line 38

however, if I specify the index.htm file after the ip address, everything works fine.

Im really really stuck

timjpriebe's picture

He has: 2,667 posts

Joined: Dec 2004

Do you have an .htaccess file? I suppose it's possible that changes elsewhere makes the system interpret the .htaccess file differently. Kind of far-fetched, but I would start by checking the .htaccess file, if you have one.

If you don't have one, you might create one. Just create a document using Notepad or some other plain text editor and save it as .htaccess

I believe the only line you would need would be the following:

DirectoryIndex index.htm

mfdc's picture

They have: 160 posts

Joined: Aug 2004

yeah understood about that, there wasnt a HTaccess file though originally. All Ive been doing is manually altering CSS files . The error points to line 38 in a PHP file. The line reads this

include($fileloc . "inc/displayposts.php");

The error to me, is saying it cannot open displayposts.php for some reason, but its there & the paths correct!

Oh dear

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

Right before line 38, add the following line:

echo "INCLUDING: " . $fileloc . "inc/displayposts.php" . "\n";

this will output to the browser what exact file it is trying to get. Whenever you do and include, sql statement, or anything else that "should work" but isn't, that uses a variable, always display the variable before the line with the error. Usually for me on SQL statements, that is where i will notice something didn't format the way i thought it did when piecing together variable/strings.

-Greg

mfdc's picture

They have: 160 posts

Joined: Aug 2004

Cheers Gregg

I still dont know whats wrong. I've changed something ( I cant remember what! ) and now when you go to the IP address it loads the content.PHP file which is the main section but fails to load the other framesets, IE mainmenu.htm & logo.htm. Its as if its bypassing the index file for some reason. Insidentally there is an index.htm file which Ive tried renaming to index.html to but still no joy

You know, heres me thinking Im good and I cant belive Ive messed this simple thing up - Im going home to spend the evening with Jack Daniels & hopefully attack the problem with a fresh head!

If anyones got anymore ideas, feel free....Id love to hear them & really appreciate the help

Mario

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.