Rochtus Posted June 21, 2009 Share Posted June 21, 2009 Is it possible in PHP to first "do" a file in the extern file you include or require And then show the result Because if you include it, it includes the file and then loads it in the file where you included it.. Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/ Share on other sites More sharing options...
RussellReal Posted June 21, 2009 Share Posted June 21, 2009 what? Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860678 Share on other sites More sharing options...
Rochtus Posted June 21, 2009 Author Share Posted June 21, 2009 Is there a PHP function that before it includes the file it runs the file? Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860679 Share on other sites More sharing options...
Ken2k7 Posted June 21, 2009 Share Posted June 21, 2009 The file will be ran once it's included or required. I don't see the problem. Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860682 Share on other sites More sharing options...
Rochtus Posted June 21, 2009 Author Share Posted June 21, 2009 Yes i know But i need to know or it is possible to first run it, and then include it Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860683 Share on other sites More sharing options...
jmr3460 Posted June 21, 2009 Share Posted June 21, 2009 Do you want to write something to a file before anything is sent to the Browser then include is from inside your body tag? Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860688 Share on other sites More sharing options...
DarkSuperHero Posted June 21, 2009 Share Posted June 21, 2009 think of it this way.... PHP FILE 1 RUN RUN RUN RUN PHP FILE 2 INCLUDED RUN RUN RUN BACKTO FILE 1 RUN RUN RUN RUN RUN EOF; hope that small diagram makes you see something, but that how php includes work...is that what your looking for ??? Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860777 Share on other sites More sharing options...
mattal999 Posted June 21, 2009 Share Posted June 21, 2009 If I understand correctly, instead of actually including the PHP code into the file, you can use a file_get_contents on the file, and this will return the pre-ran source of the file (Like running it in the browser) instead of the PHP code. Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/163132-external-file-laod/#findComment-860780 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.