SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inlcude Errors...I need eyes to see why my includes aren't working.

    Here's my code...

    PHP Code:
    <?php include "reports/report".$reportTypeID.".php?sr_id=".$sr_id.""?>
    I've also used...

    PHP Code:
    <?php include "reports/report$reportTypeID.php?sr_id=$sr_id"?>
    and this...

    PHP Code:
    <?php include ('reports/report'.$reportTypeID.'.php?sr_id='.$sr_id); ?>
    I'm getting this error/warning

    Warning: main(reports/report1.php?sr_id=397): failed to open stream: No such file or directory in /home/melindab/public_html/clients/video_report2.php on line 290

    Warning: main(reports/report1.php?sr_id=397): failed to open stream: No such file or directory in /home/melindab/public_html/clients/video_report2.php on line 290

    Warning: main(): Failed opening 'reports/report1.php?sr_id=397' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/melindab/public_html/clients/video_report2.php on line 290
    the report folder is within the clients folder, so my paths are correct. I did have the file in an IFRAME and it was working.

    Can I not use variables or parameters in an include?
    No, I REALLY dislike having to use Joomla.

  2. #2
    Always learning kigoobe's Avatar
    Join Date
    May 2004
    Location
    Paris
    Posts
    1,565
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what happens if you use something directly as
    PHP Code:
    include 'reports/report1.php?sr_id=397'
    and what happens when you use this -
    PHP Code:
    include 'reports/report1.php'
    This way you will get an idea from where the problem is coming.

    Also, since you are doing an include, probably you don't need to send the variable using sr_id with the include file. If you simply use
    PHP Code:
    include 'reports/report'.$reportTypeID.'1.php'
    , you may be able to use the variable sr_id since that is present in the parent file.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •