Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question I'm having a PHP error when trying to load a page ><

    I wrote a very simple PHP code to post a webpage in a small invisible iframe as prompted by clicks. This is my code:

    Code:
    <ilayer name="nscontainer" width=554>
    <layer name="nscontent" width=554 visibility=hidden>
    
    <!—Content goes here-->
    
    <?php include ("$page"); ?>
    
    
    <!—Stop content here-->
    
    </layer>
    </ilayer>
    And this is the error I get when I visit a webpage under the "root" (example: index.php?page=index.htm) :

    Warning: include() [function.include]: Filename cannot be empty in...(root) on (line)

    Warning: include() [function.include]: Filename cannot be empty in...(root) on (line)

    Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in....
    (root) on (line)


    Any suggestions to fix this problem? I'm sure it's very simple but I'm just overlooking it. Maybe a better code to use instead of this one?


    Thanks

    Any suggestions?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    What's the value of your variable $page? Are you replying on deprecated register_globals ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    PHP Code:
    <?php include ("$page"); ?>
    That should work unless the $page variable is empty. Do an echo on $page to see what you get. Also your HTML is really outdated. The html you are using for for Netscape browsers like version 4. You should probably just use a div that has its display set to none.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    Aug 2006
    Location
    Bangladesh(Dhaka)
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    A suggestion from http://www.sumch.com

    <?php include ("$page"); ?>

    if you give a value instead of $page variable , it will not show any error.

    Or if you declare $page="abc.php /.asp/.html/..". there is no doubt that it will work.

  • #5
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_ View Post
    PHP Code:
    <?php include ("$page"); ?>
    That should work unless the $page variable is empty. Do an echo on $page to see what you get. Also your HTML is really outdated. The html you are using for for Netscape browsers like version 4. You should probably just use a div that has its display set to none.
    Perhaps my problem is my code is a bit outdated. I've been out of coding for a couple years now (which is an eternity on the internet) so a code that may have worked before might not work on PHP 6.0. Any suggestions on a newer code that would have the same effect of pulling in a page to an iframe(or div) to a main template?

    Thanks again for the help guys.


  •  

    Tags for this Thread

    Posting Permissions

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