Jump to content

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. :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.