Hmmmm... includes help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
romeo
Forum Contributor
Posts: 138
Joined: Sun Apr 21, 2002 12:50 pm

Hmmmm... includes help

Post by romeo »

I have a page that is included in a page that is included in a page...

from page 1 to page 2 variables are passed, but from page 2 to page 3 they are not...

i.e. index.php has an include menu.php, menu.php has an include online.php... so when i pass a varable to index.php via the address (i.e. index.php?a=1)

Menu can use the variable but online.php can not...

both are include(d)


Any help?, my online.php needs those variables :)?
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

I believe that if you make a hidden html input in index.php it should be available to all other included pages.

Code: Select all

<input type="hidden" name="a" value="<? echo $a ?>">
John M
romeo
Forum Contributor
Posts: 138
Joined: Sun Apr 21, 2002 12:50 pm

nope

Post by romeo »

Nope, tried it.. any other ideas and im listening


Thanks for trying tho
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

Could your configuration be screwed up?
User avatar
puckeye
Forum Contributor
Posts: 105
Joined: Fri Dec 06, 2002 7:26 pm
Location: Joliette, QC, CA
Contact:

Post by puckeye »

Is there a way to include both files in index.php?
User avatar
bznutz
Forum Commoner
Posts: 58
Joined: Mon Dec 09, 2002 9:52 pm
Location: Here
Contact:

Post by bznutz »

Did you include any of the first two files within another function or some other limited scope block of code?
Also, did you include <? ?> within both included files?
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Going off what puckeye said, try including both files in index.php but use require_once() to avoid other problems.

John M
Post Reply