More Related Content Similar to How to Build a Web App (for Non-Programmers) (20) How to Build a Web App (for Non-Programmers)1. How to build a web app
Or at least how to understand what a web app is better than you do now.
1
13. It’s pretty much all forms
You hit a submit button and do something with a user’s data
13
14. But how do you do it?
How do you take what someone types in and build something to respond to it?
14
15. Let’s talk about HTTP
“HTTP functions as a request-response protocol in the client-server computing
model.”
15
17. The Big Nine
1. HEAD
2. GET
3. POST
4. PUT
5. DELETE
6. TRACE
7. OPTIONS
8. CONNECT
9. PATCH
17
18. The Big Nine Two
1. HEAD
2. GET
3. POST
4. PUT
5. DELETE
6. TRACE
7. OPTIONS
8. CONNECT
9. PATCH
18
28. When you type in any URL
Your browser is making a GET request.
28
29. So the very easiest way to
pass data between pages
Is by putting it in the URL. You already do this, you just don’t realize it.
29
33. To get started making
simple web apps
All you need is two things ...
33
35. 2. How to do something with
the data in the URL on the
other end
35
37. Page that will
HTTP request method process our request
(passed in URL)
<form method=“get” action=“webapp.php”>
<input type=“text” name=“stuff”>
<input type=“submit”>
</form>
Name input will be
saved under
37
38. Page that will
HTTP request method process our request
(passed in URL)
<form method=“get” action=“webapp.php”>
<input type=“text” name=“stuff”>
<input type=“submit”>
</form>
Name input will be
saved under
webapp.php?stuff=WHATEVERPEOPLETYPEIN
38
42. Now we just need to figure
out how to get stuff down
At this point we turn to our trusty language of choice.
42
45. Every language has its own
syntax for this stuff
We’re going to be using PHP because that’s what I know.
45
46. So how do I get stuff down
from the URL in PHP?
It’s simple really.
46
54. We’ll dig in on more syntax
later ...
But you get the drift.
54
56. POST is generally used for
data you’re going to save.
But for now let’s just think of it as data you don’t want to show up in a URL.
56
62. <?
if($_POST['password'] == 'password1') {
print 'AWESOMECAKE!';
} else {?>
You got the password wrong, try again.<br />
<form method="post" action="checkpassword.php">
Password: <input type="password" name="password">
<input type="submit">
</form>
<?}
?>
62
94. The Basics
✤ $string = ‘string’;
✤ if($string == ‘string’) {print this;}
✤ else {print that;}
✤ $_GET[‘field_name’];
94