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

What should I use for my web app?

Hi,

I'm planning to make a simple gym workout web app for a friend.

It will generate a complete workout program after clicking on some buttons

It goes like this:

start--> male or female--> Gain or Lose--> 1 day, 2 days, 3 days, 4 days--> print program

Can I have all this in one page? because I want the buttons to hide after it is clicked then new sets of buttons will show up.

Can I do it in javascript and query alone? or php? If I will use php, can I do it without a database? or should I use a database?

I don't really know where to start.

4 Answers

Hi Don,

You could build it in PHP, Javascript or both. Which one you choose depends on a few things.

If you need to store data that won't always be displayed in the same way, PHP with a MySQL database might be best.

However, if your inputs are few and the outputs don't vary, or vary very little, than JavaScript might be fine.

Keep in mind that with a single page JS app, unless you use URI routing and the browser History API, the user won't be able to bookmark the page.

My recommendation is that you do the Build A Simple PHP Application project: http://teamtreehouse.com/library/build-a-simple-php-application#getting-started-with-php This course will give you a good understanding of using PHP in a small project.

Thanks Keith, but one more thing. I'm done with the build a simple php app course, I learned a lot. but I don't know if I should use a form because I'm not displaying a text field. I will only display a few buttons then It'll generate a few sentences based on the buttons the user picked.

Thanks Keith, but one more thing. I'm done with the build a simple php app course, I learned a lot. but I don't know if I should use a form because I'm not displaying a text field. I will only display a few buttons then It'll generate a few sentences based on the buttons the user picked.

It seems like JavaScript might be a good lightweight solution. Will the user want to bookmark the result?

If you haven't already done it, JavaScript Foundations will lead you in the right direction: http://teamtreehouse.com/library/javascript-foundations

thanks!