Execute one PHP file from another

I currently have a webpage layout using 3 "frames" via PHP.  Each "frame" read from a separate HTML file and arranged like this:

TOP BANNER
----------------
 L |
 E | MAIN
 F | PAGE
 T |

I want to allow the "main page" to be a mix of HTML and PHP code.  I've tried readfile(), which outputs the HTML fine, but won't execute the PHP code. eval() only does one string/line at a time, and assumes everything is PHP code.  passthru() doesn't give me any output.
Adam MasonAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ZylochConnect With a Mentor Commented:
Hi majestikm00se,

Use include?

include("myfile.php");

Regards,
Zyloch
0
 
RoonaanConnect With a Mentor Commented:
Or possibly even require('myfile.php'); :-)
0
 
Adam MasonAuthor Commented:
son of a...

I thought I saw a way to do it a while back, but couldn't find it again on php.net
I was thinking it was like the C "#include"

Thanks for the quick answer.
0
All Courses

From novice to tech pro — start learning today.