4. Client Server Model
1. In client-server model, computer runs
software called the client(web browser) and it interacts
with another software called server(web server) located at
a remote computer.
2. The client is usually a browser such as Internet
Explorer, Netscape Navigator or Mozilla. Browsers
interact with the server using a set of instructions called
protocols.
3. These protocols help in the accurate transfer of data
through http requests from a web browser and responses
from the web server .
4Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
5. Client Server Model
4. The World Wide Web(WWW), which is a part of the
Internet, brings all these protocols together. we can,
use HTTP, FTP, Telnet etc. from one platform -
your & so on protocols on our web browser.
Internet protocols:
HTTP (HyperText transfer Protocol): used on the World
Wide Web (WWW) for transferring web pages and files
contained in web pages such as images.
FTP (File Transfer protocol): employed for transferring
files from one machine to the other.
SMTP (Simple Mail Transport Protocol): used to send
emails
Telnet Protocol: Used to open telnet sessions. 5
Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
6. For Static HTML page generation
The client (browser) requests for an HTML file stored
on the remote machine through the server software. The
server locate this file and passes it to the client. The
client then displays this file on your machine. In this
case, the HTML page is static. Static pages do not
change until the developer modifies them.or supportive
language required to convert it to dynamic.
6Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
7. For server side scripting /dynamic page
With server technologies like PHP, JSP it has become easier to
maintain Web pages especially helpful for a large web sites.
A request sent for a PHP page from a client is passed to the PHP
interpreter by the server along with various program variables.
The interpreter then processes the PHP code and generates a
dynamic HTML output. This is sent to the server which in turn
redirects it to the client. The browser is not aware of the
functioning of the server. It just receives the HTML code, which
it appropriately formats and displays on your computer.
7
Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
8. Http Basics: Http Protocol
1. Web servers and web browsers communicate via
HTTP.
2. The web browser (or client) makes a request of a
webpage to the server, and the webserver passes the
page back to the browser.
8Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
9. Web Server
Types:-
1. Application server
2. FTP server
3. Backup Server
4. Security Server
5. Web Server
6. File Server
7. Database Server
Web Server-is computer that runs program responsible for
accepting HTTP request from web browser & generating
HTTP response accordingly.
Ex.of web server
1. Apache web server
2. Linux server
3. IIS web server
4. SSL web server
5. WAMP windows server 9Monica Deshmane(Asst.Professor @ Haribhai
V.Desai College,Pune)
10. Web browser
How web browser interacts with web server?
1. A web browser is a software application for retrieving,
presenting, and traversing information resources on the
World Wide Web.
2. An information resource is identified by a Uniform
Resource Identifier (URI) and may be a web page,
image, video, or other piece of content.
3. Hyperlinks present in resources enable users easily to
navigate their browsers to related resources.
EX. The major web browsers are Internet Explorer,
Firefox, Google Chrome, Apple Safari, and Opera.
10Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
11. Http Protocol – How it works?
1. Parsing the URL
URL’s basic form: "protocol://server/request-URI".
Parts of url:
protocol: describes how to tell the server which
document the you want and how to retrieve it.
server: tells the browser which server to contact.
request-URI: is the name used by the web
server to identify the document.
Ex.
$url=“http://google.co.in”;
$arr=parse_url($url);
foreach($arr as $k=>$v)
echo $k,$v;
11Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
12. Http Protocol – How it works?
2. Sending the request
Usually, the protocol is "http". To retrieve a
document via HTTP the browser transmits the
following request to the server:
"GET /request-URI HTTP/version",
version tells the server which HTTP version is used.
Server performs the request and returns the result.
12Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
13. Http Protocol – How it works?
3. The server response
When the server receives the HTTP request it
locates the appropriate document and returns it.
HTTP/[VER] [CODE] [TEXT]
Ex.http/1.0 200 OK
The line shows the HTTP version used,
followed by a three-digit HTTP status code. Usually
the code is 200 and the phrase "OK“ for successful
response .
The first line is followed by some lines called the
header, which contains information about the document.
The header ends with a blank line, followed by the
document content.
13Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)
14. Http Protocol – How it works?
This is a typical header:
HTTP/1.0 200 OK
Server: Netscape-Communications/1.1
Date: Tuesday, 25-Nov-97 01:22:04 GMT
Last-modified: Thursday, 20-Nov-97 10:44:53 GMT
Content-length: 6372
Content-type: text/html
//followed by document content...
14
Monica Deshmane(Asst.Professor @ Haribhai
V.Desai College,Pune)
15. 2 tier and 3 tier architecture
Any piece of software can be subdivided into the
following areas:
Presentation logic : User Interface, displaying data to
the user, accepting input from the user.
Business logic : Business Rules, handles data
validation and task-specific behavior.
Data Access logic : Database Communication,
constructing SQL queries and executing them via the
relevant API.
15
Monica Deshmane(Asst.Professor @ Haribhai
V.Desai College,Pune)
16. 3 tier architecture
If you go one step further and split the presentation
logic from the business logic you have a 3 Tier
Architecture.
16Monica Deshmane(Asst.Professor @ Haribhai V.Desai College,Pune)