Solved

Simple PHP Question

Posted on 2004-10-04
4
209 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

717 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