Http://.

Slides:



Advertisements
Similar presentations
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Advertisements

PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
The World Wide Web and the Internet Dr Jim Briggs 1WUCM1.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
WWW, HTTP, GET, POST, Cookies Svetlin Nakov Telerik Corporation
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
PHP Introduction PHP is a server-side scripting language.
Unit 1 – Web Concepts Instructor: Brent Presley.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar Internet Programming.
What’s Really Happening
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Introduction to Information Security
Introduction to Dynamic Web Programming
Web Basics: HTML and HTTP
HTTP – An overview.
The Hypertext Transfer Protocol
How does it work ?.
Introduction to PHP FdSc Module 109 Server side scripting and
1993 version of Mosaic browser.
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Hypertext Transfer Protocol
Hypertext Transport Protocol
Introduction Web Environments
Debugging Your Website with Fiddler and Chrome Developer Tools
PHP / MySQL Introduction
PHP Introduction.
HTTP Protocol.
CISC103 Web Development Basics: Web site:
WEB API.
Web Browser server client 3-Tier Architecture Apache web server PHP
HTTP Hypertext Transfer Protocol
Hypertext Transfer Protocol
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
Hypertext Transfer Protocol
Web Server Design Week 15 Old Dominion University
Hypertext Transfer Protocol
Hypertext Transfer Protocol (HTTP)
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
Hypertext Transfer Protocol
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
PHP State.
Introduction to PHP.
Traditional Internet Applications
PHP an introduction.
HTTP Hypertext Transfer Protocol
Web Server Design Week 14 Old Dominion University
Web Servers (IIS and Apache)
Hypertext Transfer Protocol
CSCI-351 Data communication and Networks
PHP By Prof. B.A.Khivsara Note: The material to prepare this presentation has been taken from internet and are generated only for students reference and.
MSc Internet Computing
Web Application Development Using PHP
Presentation transcript:

http://

HTTP HTTP is the protocol that makes it possible for the web to work Protocol is the rule of communication between two or more entities HTTP works in a request-response manner An HTTP server serves its users by request made by the users

HTTP request HTTP response

An HTTP request & response is made for each resource 1 Page 1 JS 2 CSS 4 images = 8 HTTP requests & response An HTTP request & response is made for each resource

HTTP We can monitor HTTP requests and responses made and received by a browser using developer tools (press F12 on your browser!)

1990 – HTTP/0.9 1996 – HTTP/1.0 1999 – HTTP/1.1 2015 - HTTP/2

@timberners_lee

HTTP HTTP requests and responses are in plain text Update: in HTTP/2, it’s binary

HTTP Request GET /tentang/profil-universitas HTTP/1.1 Host: ub.ac.id Connection: keep-alive Accept: text/html User-Agent: Chrome/40.0.2214.115 Accept-Encoding: gzip, deflate Accept-Language: id,en-US Referer: http://ub.ac.id

HTTP Response HTTP/1.1 200 OK Date: Wed, 04 Mar 2015 04:44:52 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding,User-Agent Content-Encoding: gzip Content-Length: 6338 Connection: close Content-Type: text/html; charset=UTF-8

HTTP responses are followed Header Body (HTML) HTTP responses are followed by the HTML content

Header Body (HTML) HTTP/1.1 200 OK Date: Wed, 04 Mar 2015 04:44:52 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding,User-Agent Content-Encoding: gzip Content-Length: 6338 Connection: close Content-Type: text/html; charset=UTF-8 <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> Header Body (HTML)

HTTP Status Code An HTTP response contains an HTTP status code

HTTP Status Code status code HTTP/1.1 200 OK Date: Wed, 04 Mar 2015 04:44:52 GMT Server: Apache/2.2.15 (CentOS) X-Powered-By: PHP/5.3.3 Vary: Accept-Encoding,User-Agent Content-Encoding: gzip Content-Length: 6338 Connection: close Content-Type: text/html; charset=UTF-8

HTTP Status Code 1xx – Informational 2xx – Success 3xx – Redirection 4xx – Client error 5xx – Server error

Common HTTP Status Codes 200 OK: Request is fulfilled 304 Not Modified: Requested resource has not been modified 400 Bad Request: Request could be understood (syntax error) 403 Forbidden: Server refuses to supply the resource

HTTP Methods GET HEAD POST OPTIONS PUT DELETE TRACE CONNECT

PHP Introduction

Created by Rasmus Lerdorf in 1994 @rasmus

PHP Introduction A simple yet powerful language designed for creating HTML content

PHP Introduction Can be used in three primary ways: Server-side scripting Command-line scripting Client-side application (using PHP-GTK, gtk.php.net)

PHP Introduction PHP runs on all major operating systems: from Unix variants including Linux, FreeBSD, Ubuntu, Debian, and Solaris to Windows and Mac OS X It can be used with many web servers: Apache, Microsoft IIS, and nginx

PHP Introduction PHP also has built-in support for generating PDF files, GIF, JPG, and PNG images

PHP Introduction Supports all major databases: MySQL, PostgreSQL, Oracle, Sybase, MS-SQL, and DB2

PHP Introduction PHP HTML PHP pages are generally HTML pages with PHP commands embedded in them PHP HTML

PHP Introduction <html> <head> <title>Look Out World</title> </head> <body> <?php echo "Hello, world!"; ?> </body> </html>

PHP Introduction The web server processes the PHP commands and sends their output

HTML PHP

Server- and Client-side Scripting

Server- and Client-side Scripting Make sure a web server is installed on your laptop Your server-side scripts must be stored in the htdocs (or WWW folder in nginx)

Server- and Client-side Scripting (htdocs/helloworld/hello.php) <!DOCTYPE html> <html><body> <h1><?php $hello = “Hello “; $world = “world!”; echo $hello, $world; ?></h1> </body></html>

Server- and Client-side Scripting Now open “localhost/helloworld/hello.php” on your browser

Server- and Client-side Scripting Rename “hello.php” to “index.php” then open “localhost/helloworld” on your browser “index.php” is the default file in the web server so you don’t have to specify the file name in the URL

Server- and Client-side Scripting Server-side scripts are run on server, while client-side ones are run on client (browser)

Server- and Client-side Scripting (htdocs/helloworld/server_client Server- and Client-side Scripting (htdocs/helloworld/server_client.php) <!DOCTYPE html> <html><body> <?php $var1 = 10; $var2 = 20; echo “Server output: “, $var1 * $var2; ?> <div id=“client”></div> <script> var var1 = 10; var var2 = 30; var hasil = “Client output: ” + var1 * var2; document.querySelector(“#client”).innerHTML = hasil; </script> </body></html>

Server- and Client-side Scripting Open “localhost/helloworld/server_client.php” on your browser

Server- and Client-side Scripting Now view the page source by pressing Ctrl+U on your browser

Page Source <!DOCTYPE html> <html><body> Server output: 200 <div id="client"></div> <script> var var1 = 10; var var2 = 30; var hasil = "Client output: " + var1 * var2; document.querySelector("#client").innerHTML = hasil; </script> </body></html>

Server-side Scripts Server Client Server-side Page scripts Output HTML Run script Transfer Page HTML Render in browser

Client-side Scripts Client Server Page Client-side scripts + HTML Run script Transfer

?>