Jump to content

[SOLVED] Variables and Includes HELP


oasmar

Recommended Posts

Hi, I have been trying to program in php for a long time and i feel i am finally getting the hang of many simple things, but as i was making my newest script (most complex.... for me anyway  ::) )  I have made a two files, each one REQUIRES the other but they can not be together.

 

An Example of my Problem is:

 

File 1 -----include-----> File 2 ----include-----> File A

                                          \----include-----> File B

 

File A and B are included into File 2, File A has variable $example_variable which is required in File B, but for some reason File B can not see this variable. File 2 is then included in File 1, which is the actual page. Is it possible to use variables in one include in another?

 

PS. Anyone got a good link to a website explaining what PHP Classes are?

Link to comment
https://forums.phpfreaks.com/topic/72508-solved-variables-and-includes-help/
Share on other sites

Because, in reality it isnt just two files, its two types of file.

 

It could be:

File 1 + File A

File 1 + File B

File 1 + File C

File 1 + File D

File 1 + File E

File 2 + File A

File 2 + File B

File 2 + File C

File 2 + File D

File 2 + File E

File 3 + File A

File 3 + File B

File 3 + File C

File 3 + File D

File 3 + File E

 

As you can see, there are only 8 files there but 15 combinations made available using them. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.