Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Darry Berger
PLUS
Darry Berger
Courses Plus Student 6,818 Points

Am i supposed to convert?

I created a website to sell a service before i started learning PHP, but now that I've begun learning PHP so that i could charge for my service i've run into a problem.

I have a bunch of html files and css files. Should i be converting all my html files that contain php code to php?

Also, would it cause a error to use a mix of php and html files for a website?

PS: Should i be converting all the html i have written into php or leave it in html? ( such as creating separate header and footer files and including them via php )

1 Answer

Hey!

If you want to use php code, it needs to be in a .php file otherwise the server wont know it has to do something before sending html to the browser.

You can use both html, css, js etc alongside php. Just make sure your php is in <?php ?> tags. The "creating a php application" badge should give you loads more info - I recently went through a similar change following this badge!

From personal experience, including the header/footer etc made my workflow much faster - why change 8 navigations if you can only change one? It depends on your workspace, i.e. Dreamweaver templates might offer enough functionality.

I hope this helps,

Tom