Introduction To Web Techniques

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Ch 1: Introduction to web techniques [8]

1.1 HTTP basics,

Introduction to Web server and Web browser

1.2 Introduction to PHP

1.3 What does PHP do?

1.4 Lexical structure

1.5 Language basics


HTTP Basic

HTTP stands for Hyper Text Transfer Protocol


WWW is about communication between web clients and servers
Communication between client computers and web servers is done by sending HTTP Requests and receiving HTTP
Responses

Hypertext Transfer Protocol (HTTP) is a method for encoding and transporting information between a client (such as a
web browser) and a web server. HTTP is the primary protocol for transmission of information across the Internet.
HTTP features

HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP request and after a request is made, the client
waits for the response. The server processes the request and sends a response back after which client disconnect the
connection. So client and server knows about each other during current request and response only. Further requests
are made on new connection like client and server are new to each other.
HTTP is media independent: It means, any type of data can be sent by HTTP as long as both the client and the server
know how to handle the data content. It is required for the client as well as the server to specify the content type using
appropriate MIME-type.
HTTP is stateless: As mentioned above, HTTP is connectionless and it is a direct result of HTTP being a stateless
protocol. The server and client are aware of each other only during a current request. Afterwards, both of them forget
about each other. Due to this nature of the protocol, neither the client nor the browser can retain information between
different requests across the web pages.
HTTP Session

Basically, HTTP is a TCP/IP based communication protocol, that is used to deliver data (HTML files,
image files, query results, etc.) on the World Wide Web. The default port is TCP 80, but other ports
can be used as well. It provides a standardized way for computers to communicate with each other.
HTTP specification specifies how clients' request data will be constructed and sent to the server,
and how the servers respond to these requests.

Uniform Resource Locator


URL stands for Uniform Resource Locator, and is used to specify addresses on the World Wide
Web. A URL is the fundamental network identification for any resource connected to the web (e.g.,
hypertext pages, images, and sound files). The protocol specifies how information from the link is
transferred.
HTTP Request
HTTP (Hypertext Transfer Protocol), is the underlying format that is used to structure request for effective
communication between a client and a server. The message that is sent by a client to a server is what is known as an HTTP
request. HTTP Request is a packet of information that one computer sends to another computer to communicate
something.

format
1. Request-line or opening line
2.Zero or more header (optional)
3.An empty line indicating the end of the header fields
4.Optionally a message-body

Format of opening line

Method,path and HTTP version


Ex:- 1GET/database/homepage.html HTTP/1.0
HTTP Response

An HTTP response is made by a server to a client. The aim of the response is to provide the client with the resource it
requested, or inform the client that the action it requested has been carried out; or else to inform the client that an error
occurred in processing its request.

Format
After receiving and interpreting a request message, a server responds with an HTTP response message.

Response = Status-Line
( header )
[ message-body ]
6.1 Status-Line
The first line of a Response message is the Status-Line, consisting of the protocol version followed by a numeric status
code and its associated textual phrase, with each element separated by SP characters. No CR or LF is allowed except in
the final CRLF sequence.

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

ex: HTTP/1.0 200 OK


Status Codes

Message Description

200 OK The request is OK.

201 Created The request is complete, and a new resource is created .

202 Accepted The request is accepted for processing, but the processing is not complete.

203 Non-authoritative Information The information in the entity header is from a local or third-party copy, not from the original
server.

204 No Content A status code and a header are given in the response, but there is no entity-body in the
reply.

205 Reset Content The browser should clear the form used for this transaction for additional input.

206 Partial Content The server is returning partial data of the size requested. Used in response to a request
specifying a Range header. The server must specify the range included in the response
with the Content-Range header.
Server
A server is a computer program or device that provides a service to another computer known as the client.

Types of server
1.File servers
File servers store and distribute files. Multiple clients or users may share files stored on a server. File server hardware
can be designed to maximize read and write speeds to improve performance.
2.Print servers
Print servers allow for the management and distribution of printing functionality.
3.Application servers
Application servers used to share applications. It also removes the need to install and maintain software on many
machines as opposed to only one.
4.DNS servers
Domain Name System (DNS) servers are application servers that provide name resolution to client computers by
converting names easily understood by humans into machine-readable IP addresses.
5.Mail servers
Mail servers receive emails sent to a user and store them until requested by a client on behalf of said user.

6.Web servers
A web server is server software, or hardware dedicated to running this software, that can satisfy client requests on
the World Wide Web. A web server can, in general, contain one or more websites Common web servers include
Apache web servers, Microsoft Internet Information Services (IIS) servers and httpd servers.
Web Browser

A web browser (commonly referred to as a browser) is a software application for accessing information on the World
Wide Web.

Ex.
1. Internet Explorer
2. Saphari
3. Crome
4. Mozila firefox
5. Oprera
etc
Client Server Architecture

Client server architecture is a computing model in which the server hosts, delivers and manages most of the
resources and services to be consumed by the client.
This type of architecture has one or more client computers connected to a central server over a network or internet
connection.

You might also like