Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Basic PHP Website (2018) Building a Media Library in PHP Including the Footer and Adding Additional Pages

Damir Pauli─ç
Damir Pauli─ç
6,591 Points

Is this how it is done in real life PHP webpages?

In real life practice do we use PHP to include header and footer or is it done differently (Through java script or HTML somehow)

I always though PHP should be used in background, for example to manipulate data, and not in displaying pages.

2 Answers

jamesjones21
jamesjones21
9,248 Points

PHP can be used as a templating engine, so you can keep the same header and footer, just switch the content around :) wordpress themes are split up into sections such as navbar, content, header and footer.

PHP is a great language to learn, and it is user friendly too.

Hope this helps.

Pascal Breitr├╝ck
PLUS
Pascal Breitr├╝ck
Courses Plus Student 3,205 Points

Hey, of course it's not best practice. But you have to understand the basics of php before you start your normal working life. What good is it if you can move a racing car with automatic transmission but a normal one won't move. PHP is versatile and easy, learn it and love it . stand out from the crowd. Ps. php is not for displaying pages ....... Yes php give us html but in your code you can use php for great templates look ­čĹÇ @ TWIG one of the best templates engines .... you will love it ­čśŹ

Greets Pascal