Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 437
  • Last Modified:

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.
0
Adam Mason
Asked:
Adam Mason
2 Solutions
 
ZylochCommented:
Hi majestikm00se,

Use include?

include("myfile.php");

Regards,
Zyloch
0
 
RoonaanCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now