278.67K
Категория: ПрограммированиеПрограммирование

PHP. (Lesson 7)

1.

PHP
Lesson 7

2.

PHP HTTP
Parameters
Uniform Resource Identifiers (URI)
URI = "http:" "//" host [ ":" port ] [ abs_path
[ "?" query ]]
http://example.com/home?
view=some_view&cid=1

3.

PHP HTTP Head
Method
Head same as GET, but only transfer the status
line and header section.
HEAD
GE
T
Request
Request
.
.
Respons
e.
Respons
e.

4.

PHP HTTP Headers
get_headers
get_headers() returns an array with the headers sent by the
server in response to a HTTP request.

5.

PHP HTTP Headers
header()
The header() function sends a raw HTTP header to a client.
It is important to notice that header() must be called before any
actual output is sent.
header('Location: http://www.example.com/');

6.

PHP HTTP Headers
header()
Refresh page with php
header("Refresh: seconds")
Refresh page with meta
tags
<meta http-equiv="refresh" content="5">
Refresh page with
javascript
window.location.reload()

7.

PHP HTTP Headers
Header Cache Control

8.

PHP URL Functions
parse_url()
Parse a URL and return its
components
urlencode()
URL-encodes string
urldecode()
Decodes URL-encoded
string

9.

Tasks
1. Ստուգել user-ի կողմից մուտք արված url-ը standalone է, թե
ոչ:
English     Русский Правила