2014 database - course 1 - www introductionHung-yu Lin
?
This document provides an introduction to HTML, HTTP protocols, and how to build a basic web server. It begins with an overview of what happens when a browser opens a URL, including DNS lookup and the HTTP request. It then discusses the HTTP protocol and how GET, POST, PUT, and DELETE map to CRUD operations and REST APIs. The document explains how to parse an HTTP request and handle responses in a simple web server. It also introduces CGI as a way to execute scripts or programs on the server side. Finally, it provides recommendations for text editors and references for HTML, CSS, JavaScript, and building websites.
The document discusses Google App Engine (GAE), which is a Platform as a Service (PaaS) that allows developers to build and host web applications in Google's infrastructure. It focuses on providing automatic scaling, security, performance, and supports languages like Python and Java. GAE provides data storage options like the Datastore for NoSQL data and Blobstore for binary objects. The Datastore uses entities with properties to store data, generates unique keys for entities, and supports common data types that can be queried, inserted, updated and deleted.
The document discusses PHP and how it works with HTML. PHP code is embedded within HTML code using opening and closing PHP tags. Variables and data from PHP can be outputted into the HTML. Forms allow sending data to PHP scripts via GET or POST requests. The PHP script receives the form data in the $_POST or $_GET superglobals. Sessions allow maintaining state across multiple requests by assigning a temporary ID stored in a cookie.
Redis is a fast, in-memory key-value database that supports data types like strings, lists, sets and hashes. It features publish-subscribe capabilities, transactions, replication, persistence and partitioning. It is open source and offers clients for many programming languages. Major companies like GitHub, Twitter, Pinterest, and others use Redis for caching, pub/sub messaging and more due to its speed and feature set.
2014 database - course 3 - PHP and MySQLHung-yu Lin
?
This document discusses connecting to a MySQL database from PHP. It explains how to establish a database connection, perform queries like INSERT, SELECT, UPDATE and DELETE, and handle query results. It emphasizes that using prepared statements prevents SQL injection attacks. It also covers password hashing to securely store passwords in the database by hashing them with a random salt.
2014 database - course 1 - www introductionHung-yu Lin
?
This document provides an introduction to HTML, HTTP protocols, and how to build a basic web server. It begins with an overview of what happens when a browser opens a URL, including DNS lookup and the HTTP request. It then discusses the HTTP protocol and how GET, POST, PUT, and DELETE map to CRUD operations and REST APIs. The document explains how to parse an HTTP request and handle responses in a simple web server. It also introduces CGI as a way to execute scripts or programs on the server side. Finally, it provides recommendations for text editors and references for HTML, CSS, JavaScript, and building websites.
The document discusses Google App Engine (GAE), which is a Platform as a Service (PaaS) that allows developers to build and host web applications in Google's infrastructure. It focuses on providing automatic scaling, security, performance, and supports languages like Python and Java. GAE provides data storage options like the Datastore for NoSQL data and Blobstore for binary objects. The Datastore uses entities with properties to store data, generates unique keys for entities, and supports common data types that can be queried, inserted, updated and deleted.
The document discusses PHP and how it works with HTML. PHP code is embedded within HTML code using opening and closing PHP tags. Variables and data from PHP can be outputted into the HTML. Forms allow sending data to PHP scripts via GET or POST requests. The PHP script receives the form data in the $_POST or $_GET superglobals. Sessions allow maintaining state across multiple requests by assigning a temporary ID stored in a cookie.
Redis is a fast, in-memory key-value database that supports data types like strings, lists, sets and hashes. It features publish-subscribe capabilities, transactions, replication, persistence and partitioning. It is open source and offers clients for many programming languages. Major companies like GitHub, Twitter, Pinterest, and others use Redis for caching, pub/sub messaging and more due to its speed and feature set.
2014 database - course 3 - PHP and MySQLHung-yu Lin
?
This document discusses connecting to a MySQL database from PHP. It explains how to establish a database connection, perform queries like INSERT, SELECT, UPDATE and DELETE, and handle query results. It emphasizes that using prepared statements prevents SQL injection attacks. It also covers password hashing to securely store passwords in the database by hashing them with a random salt.
7. Hostname and IP
? IP is an Unique identifier
– 就像身分証一樣
? 網路有自己的機制,可以讓你輸入IP就找到
那台機器。
? http://140.113.41.8
– 但這不make sense
? http://www.nctu.edu.tw
– It’s great!
14. HTTP Request Method
GET /register HTTP/1.1
Host: comic.ensky.tw
OR
GET http://comic.ensky.tw/register HTTP/1.1
Method URI Protocol_version
Key: value
15. HTTP Request Method
? GET http://comic.ensky.tw/register HTTP/1.1
? GET
– Read, 讀取資料
? POST
– Create, 新增資料
? PUT
– Update, 修改資料
? DELETE
– Delete, 刪除資料