Help! Failed opening for inclusion Error

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.

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

Whats wrong with it?
LVL 1
Terry RogersIT Senior EngineerAsked:
Who is Participating?
 
RoonaanConnect With a Mentor Commented:
Hi,

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

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

Or:

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>

-4-

0
 
Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
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'); ?>

and

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

Regards,

Richard Quadling.
0
 
Terry RogersIT Senior EngineerAuthor Commented:
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.
0
 
Terry RogersIT Senior EngineerAuthor Commented:
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 &
http://will01.williams.uk.com/calendar/holidays.php?issue=03/05/2006

You can see the scripts work fine.
0
 
Terry RogersIT Senior EngineerAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.