Introduction to Server-Side Programming

Introduction to Server-Side Programming

Charles Liu

Overview

1. Basics of HTTP 2. PHP syntax 3. Server-side programming 4. Connecting to MySQL

Request to a Static Site

HTTP Request: GET

Server: 1. Homepage

lookup 2. Send as HTTP

Response

You (client)

HTTP Response: web content (HTML file) Client-side code: HTML, CSS, JavaScript

Web server IP: 72.26.203.99

Request to a Dynamic Site

! The server must respond dynamically if it needs to provide different client-side code depending on the situation ! Date and time ! Specifics of the user's request ! Database contents ? forms and authentication

You (client)

HTTP Request: GET

Server: 1. Look up things that go on

user's profile, such as wall posts and friends "

caches, database

Web server lookups

2. Generate client-side

HTTP Response: web content (HTML file) Client-side code: HTML, CSS, JavaScript (dynamically generated by server)

code containing these things 3. Send as HTTP response

sample http interactions

> GET, data passed as query string

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download