Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-01-2010, 06:43 AM   PM User | #1
wushudragon84
New to the CF scene

 
Join Date: Jan 2010
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
wushudragon84 is an unknown quantity at this point
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?
wushudragon84 is offline   Reply With Quote
Old 01-01-2010, 08:10 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
What's the value of your variable $page? Are you replying on deprecated register_globals ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 01-01-2010, 08:12 AM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
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!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 01-01-2010, 09:04 AM   PM User | #4
sumch
New to the CF scene

 
Join Date: Aug 2006
Location: Bangladesh(Dhaka)
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
sumch is an unknown quantity at this point
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.
sumch is offline   Reply With Quote
Old 01-01-2010, 04:00 PM   PM User | #5
wushudragon84
New to the CF scene

 
Join Date: Jan 2010
Posts: 8
Thanks: 3
Thanked 0 Times in 0 Posts
wushudragon84 is an unknown quantity at this point
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.
wushudragon84 is offline   Reply With Quote
Reply

Bookmarks

Tags
code, error, fail, php, trouble

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:12 PM.


Advertisement
Log in to turn off these ads.