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

jamesjones21
jamesjones21
9,260 Points

Code Review

I have created a simple calculation page which only adds two numbers, could someone please tell me if I am referencing the sheet of the PHP as include into the web page is the correct way of doing it ?

Current work space below:

https://w.trhou.se/o2cclw1pkr

1 Answer

Mohammed Jammeh
Mohammed Jammeh
37,463 Points

Your code looks fine, James. It will surely work. However, I will recommend that you put the PHP tags at the top of the page instead of placing them between the head and body. This will make it easier for you to refer to your code and differentiate between PHP and HTML when the document gets longer but it does look fine. Nice one!!

jamesjones21
jamesjones21
9,260 Points

Thanks Mohammed, when I was updating it I did notice the include after the last head tag, so moved it up.

Would you know of a way how to use one variable to handle the answer to all questions ?

Regards, James