Help! Failed opening for inclusion Error

Posted on 2006-05-09
Last Modified: 2008-03-03
I have no idea why but im getting the following error when accessing

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?issue=03/05/2006

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

    Accepted Solution


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

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


    include '';
    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

    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.
    LVL 1

    Author Comment

    by:Terry Rogers
    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.
    LVL 1

    Author Comment

    by:Terry Rogers
    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 ... &

    You can see the scripts work fine.
    LVL 1

    Author Comment

    by:Terry Rogers
    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

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    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 …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now