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

General Discussion

davidreyes2
davidreyes2
3,422 Points

What do I need to learn?

I want to input data in a form and make it show up as html in another page.

A form is done in html,

but where does the data go?

how do I get that data to go into another page as html?

I want to make sure to learn the right steps to achieve this.

I am learning javascript, but I feel like that is not what I need for this particular problem.

2 Answers

Travis Adams
Travis Adams
3,667 Points

This could easily be achieved with PHP.

I would start with Treehouse’s Front-End Development Track. Subsequently, you'll be able to make an informed decision. See, there’s so many things you can do — and so many ways that you can do them — that it would be irresponsible of me to just answer with, “Learn Ruby,” or anything so specific. Here's how the whole shebang kinda works though:

How’d the form get there?

  • HTML forms appear in your browser because a server sent them

How’d the server know to do that?

  • Well, presumably, you typed in a URL in your browser
  • The browser then sends a request to the server asking it to do things

What the hell is a waiter, I mean server?

  • It’s just a computer, pretty much exactly like the one you’re on right now, with a few minute differences
  • Like, all the software on the server is there because it’s required or helpful to get the job done; it’s a computer that’s been optimized for specific metrics, e.g. speed

How does the browser know which server to send it to?

  • The URL (Uniform Resource Locator) you type in holds a lot of info
  • Like the address to that particular server’s location
  • Like info on what you want the server to do when it receives your request

What’s all this got to do with my form data?

  • The server built the HTML form before it sent it to you
  • As such, when you fill out the form and hit submit, another request is sent to the server from your browser
  • Except this time, the form data you submitted is sent along with the rest of the request
  • Because the server built the form, it knows what to do when the form is submitted back to it with data

Shut up! I just want to submit a form and have the data come back as another HTML page?

  • As you know, the form itself is madeup of code called HTML
  • The way the form looks — it’s presentation, how big the input box is, what font is being used — is manipulated by code called CSS
  • The behaviour of the form — does it pop up out of nowhere, does it disappear on submit, does the page reload on submit — is controlled by a language called JavaScript
  • The minute the form is sent to the server, however, all bets are off; there is no real standard of what happens next
  • The server contains programs written in whatever language you want to write them in: Ruby, Python, Java, etc. and now even JavaScript
  • These programs are the actual software that created and served the initial HTML file
  • They also can do more than that like retrieve more data from this other optimized-computer called a Database, do whatever they want to that data, and then send that data to your browser for your viewing pleasure

So, like, what do I need to learn?

  • Like I said, I would start by completing the Front-End Development Track
  • Then, you’ll likely want to do more than fill out a form and have an HTML page appear
  • Only then will it make sense to ask, “what should I learn next?”
  • You could Learn Flask
  • You could Learn Rails
  • You could Stick with JavaScript
  • Or you could do, literally, anything else; the world will be your goddamn oyster. I’m not sure what oysters have to do with this either, but people say that…I swear.

I’ve definitely left a bunch of stuff out but I hope that this helps you out a little man. I don’t really have time to proofread this behemoth so if something isn’t making sense, just call me out on it and I’ll elaborate.