Skip to Content
PHP编程:第4版
book

PHP编程:第4版

by Kevin Tatroe, Peter MacIntyre
January 2021
Intermediate to advanced
505 pages
9h 45m
Chinese
Publishing House of Electronics Industry
Content preview from PHP编程:第4版
189
8
Web
技术
设计
PHP
的初衷就是让其充当网页脚本语言,虽然它可以用在纯命令行和
GUI
脚本中,
但制作网页仍是
PHP
的主要用途。一个动态网站中会有表单、会话,有时还有重定向,
本章将阐述如何实现这些功能。你将了解到
PHP
如何提供访问表单参数和上传文件,如
何发送
cookie
和进行浏览器重定向,以及如何使用
PHP
会话等。
HTTP
基础
Web
运行在
HTTP
(超文本传输协议)之上。这个协议支配网页浏览器如何向服务器
请求文件和如何从服务器发回文件。要理解本章将向你展示的各项技术,你需要有一
HTTP
基础。更多关于
HTTP
的探讨,可以参看
Clinton Wong
写的
HTTP Pocket
Reference
一书(由
O
Reilly
出版)。
当浏览器请求一个网页时,它会将
HTTP
请求消息发送到网页服务器。请求消息包含一
些标头信息,有时候还会包含一些正文。网页服务器用一个回复消息来响应,回复消息
总是包含标头信息并且通常包含正文。
HTTP
请求的首行看起来像下面这样
GET /index.html HTTP/1.1
该行指定了一个
HTTP
命令,叫作“方法”,紧跟着的是文件地址和所使用的
HTTP
议版本。在这个例子中,请求使用了
GET
方法和
HTTP 1.1
版本来请求
index.html
文件。
首行过后,请求中包含的标头信息会告诉服务器关于该请求的额外数据。例如
User-Agent: Mozilla/5.0 (Windows 2000; U) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley
算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez

Publisher Resources

ISBN: 9787121404634