oasmar Posted October 9, 2007 Share Posted October 9, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/72508-solved-variables-and-includes-help/ Share on other sites More sharing options...
MmmVomit Posted October 9, 2007 Share Posted October 9, 2007 Why can't File A and File B be combined? Quote Link to comment https://forums.phpfreaks.com/topic/72508-solved-variables-and-includes-help/#findComment-365623 Share on other sites More sharing options...
oasmar Posted October 9, 2007 Author Share Posted October 9, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/72508-solved-variables-and-includes-help/#findComment-365627 Share on other sites More sharing options...
oasmar Posted October 9, 2007 Author Share Posted October 9, 2007 My problem was i forgot to put Global in "File B"'s function..... Quote Link to comment https://forums.phpfreaks.com/topic/72508-solved-variables-and-includes-help/#findComment-365648 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.