Solved

Simple PHP Question

Posted on 2004-10-04
4
200 Views
Last Modified: 2013-12-25
Here is what I have:

an include directory with the following:
style.php
header.php
footer.php

inside index.php source is the following:

<?php include("style.php"); ?>

<?php include("header.php"); ?>

<?php include("footer.php"); ?>

Only one that works is header.php, style.php and footer.php are uploaded.  Error I get is:

Warning: main(footer.php): failed to open stream: No such file or directory in /xxx/about_more.php on line 81

Warning: main(footer.php): failed to open stream: No such file or directory in /xxx/about_more.php on line 81

Warning: main(): Failed opening 'footer.php' for inclusion (include_path='.:/usr/local/lib/php') in /xxx/about_more.php on line 81
0
Comment
Question by:precision
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
nicholassolutions earned 350 total points
ID: 12219828
Try putting the FULL path in your includes, e.g.:

<?php include('/home/username/includes/footer.php'); ?>

It looks like PHP may not be looking in the directory where you have your stuff.
0
 

Author Comment

by:precision
ID: 12219861
I will try that but 1 out of the 3 work and they are all in the same locations with the same calls as above.
0
 

Author Comment

by:precision
ID: 12219884
Bingo!  Don't ask me why, 1 worked and the 2 others did not as I had originally.  When I did what you recommended they all work with the full path.  Thanks!
0
 
LVL 15

Expert Comment

by:nicholassolutions
ID: 12220296
glad to help ;)
That problem got me a bunch of times when I was starting out with PHP...and a couple times since ;)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question