Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: Whats Wrong?

  1. #1
    Rin
    Rin is offline
    Junior Member
    Join Date
    Mar 2003
    Location
    UK
    Posts
    8
    Member #
    797
    Can anyone tell me what's wrong with this code?

    PHP Code:
    <?
    $time_period 
    date("m");
    include(
    "$time_period"."php");
    ?>
    It suposed to Include a different page every month, however...

    I get this instead
    Code:
    Warning: main(04php) [function.main]: failed to create stream: No such file or directory
     in /home/rinuial/public_html/template/footer.php on line 15
    
    Warning: main() [function.main]: Failed opening '04php' for inclusion
     (include_path='') in /home/rinuial/public_html/template/footer.php on line 15
    Can anyone tell me what I'm doing wrong...

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Make sure it's echoing a valid filename:
    PHP Code:
    echo $time_period ".php"
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Check the error message... there's no "." before your file extension. Try this:
    PHP Code:
    <?
    $time_period 
    date("m");
    include(
    "$time_period".".php");
    ?>

  5. #4
    Rin
    Rin is offline
    Junior Member
    Join Date
    Mar 2003
    Location
    UK
    Posts
    8
    Member #
    797
    Thanks

    Thanks For your help, it works now


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:33 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com