Help! Failed opening for inclusion Error

Posted on 2006-05-09
Medium Priority
Last Modified: 2008-03-03
I have no idea why but im getting the following error when accessing http://will01.williams.uk.com/just4us/issue28-apr06/issue28.php

Warning: Failed opening '/calendar/holidays.php?bday=1&issue=03/05/2006' for inclusion (include_path='.:/usr/share/pear') in /vol1/intranet/just4us/issue28-apr06/issue28.php on line 65

Warning: Failed opening '/calendar/holidays.php?issue=03/05/2006' for inclusion (include_path='.:/usr/share/pear') in /vol1/intranet/just4us/issue28-apr06/issue28.php on line 69

Line 65 is <?php include '/calendar/holidays.php?bday=1&issue=03/05/2006'; ?>

and Line 69 is <?php include '/calendar/holidays.php?issue=03/05/2006'; ?>

The scripts that the include points to works fine in the browser on its own.


Whats wrong with it?
Question by:Terry Rogers
  • 3
LVL 49

Accepted Solution

Roonaan earned 1000 total points
ID: 16639126

From filesystem you cannot just include somescript.php?issue. You can only use:

$issue = 'something';
include 'calendar/holidays.php';


include 'http://mydomain.com/calendar/holidays.php?issue=03/05/2006';
But this second one is mighty inefficient.

This is because ?var=value&var=value part is a querystring for URL's and is invalid for relative or absolute paths in the filesystems.

Are you actually looking for including, or did you intend to use an iframe?

<iframe src="/calendar/holidays.php?issue=03/05/2006" height="300"  width="300"></iframe>


LVL 40

Assisted Solution

by:Richard Quadling
Richard Quadling earned 1000 total points
ID: 16639138
Hi TerryRogers,

Are the "includes" just some PHP code or are they the output of the PHP code?

Try ...

<?php echo file_get_contents('http://will01/calendar/holidays.php?bday=1&issue=03/05/2006'); ?>


<?php echo file_get_contents('http://will01/calendar/holidays.php?issue=03/05/2006'); ?>


Richard Quadling.

Author Comment

by:Terry Rogers
ID: 16639162
Sorry the includes above are wrong, they are set as follows ...

Line 65 is <?php include 'http://will01/calendar/holidays.php?bday=1&issue=03/05/2006'; ?>

and Line 69 is <?php include 'http://will01/calendar/holidays.php?issue=03/05/2006'; ?>

I changed them to the above post to see if they would work.

This include has worked for the past 3-4 months and now isn't, and I don't know why. Need some help in working out what is wrong.

Also I don't use iFrames and do not want to. Just want to get it working again how it was.

Author Comment

by:Terry Rogers
ID: 16639235
RQuadling, your echo file_get_contents did not work.

Just get a blank area where id expect to see my results.

If you look here ...

http://will01.williams.uk.com/calendar/holidays.php?bday=1&issue=03/05/2006 &

You can see the scripts work fine.

Author Comment

by:Terry Rogers
ID: 16639255
ok, I have it working now. I replaced the will01 with the machine ip address and all started to work again.

Thanks for the help.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 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