Gayner Posted December 13, 2009 Share Posted December 13, 2009 I did a query in my index.php and my results can be seen when i put in a different .php and include it hahaha epic.. so like in my index.php i got results from table {$data['id']} and i use include 'profile.php' then i put {$data['id']} in my profile.php at very top and it WORKS HAAA This is epic is there any other stuff i can do ? This is will help so much, now my 5000 line index.php can become cleaner! hahaha Quote Link to comment https://forums.phpfreaks.com/topic/184941-i-didnt-know-we-could-do-this/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2009 Share Posted December 13, 2009 From the include() page of the php manual - When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. Quote Link to comment https://forums.phpfreaks.com/topic/184941-i-didnt-know-we-could-do-this/#findComment-976311 Share on other sites More sharing options...
emopoops Posted December 13, 2009 Share Posted December 13, 2009 huh? r u meaning u didnt know u could include a file? i dont get it Quote Link to comment https://forums.phpfreaks.com/topic/184941-i-didnt-know-we-could-do-this/#findComment-976313 Share on other sites More sharing options...
Gayner Posted December 13, 2009 Author Share Posted December 13, 2009 From the include() page of the php manual - When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward. HAha awesome bro thanks this is great help ty Quote Link to comment https://forums.phpfreaks.com/topic/184941-i-didnt-know-we-could-do-this/#findComment-976314 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.