|
Posted by Andy Hassall on 07/02/05 00:43
On 1 Jul 2005 14:36:02 -0700, mdawg414@gmail.com wrote:
>Hey guys, please bear with me cause I am a major newbie at php. I am
>building a website and have it so that the content in the middle of the
>page changes but the banner on top and the panels on the sides do not.
>The way I am doing this is by having a top.php file and a bottom.php
>file and in my file index.php it would look like this:
><?php
>include("top.php");
>?>
>Here is my index stuff...
><?php
>include("bottom.php");
>?>
>
>and that works great. However, I thought it would be cool to have it so
>that one of the panels changed for each website so that it was specific
>to the page you were on but the others stayed the same. So I thought I
>could do include("top.php?panel=homepage"); and edit the top.php page
>accordingly. However, this does not work. Thanks so much for your help.
?panel=homepage is for HTTP requests.
This include() is not doing an HTTP request, it is reading from the
filesystem.
There's no such file named "top.php?panel=homepage". So it won't work.
Since this is PHP reading PHP, you simply set the appropriate variable in your
outer file, and the file in the inner scope have it available as described in
the manual.
http://uk2.php.net/include/
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Navigation:
[Reply to this message]
|