How the web works: HTTP and CGI explained

原文链接:http://www.garshol.priv.no/download/text/http-tut.html

Introduction

About this tutorial

This is an attempt to give a basic understanding of how the web works and was written because I saw so many articles on various news groups that plainly showed that people needed to learn this. Not knowing of any one place to find this info, I decided to collect it into an article. Hope you find it useful!

It covers the HTTP protocol, which is used to transmit and receive web pages, as well as some server workings and scripting technologies. It is assumed that you already know how to make web pages and preferably some HTML as well.. It is also assumed that you have some basic knowledge of URLs. (A URL is the address of a document, what you need to be able to get hold of the document.)

I’m not entirely happy with this, so feedback would be very welcome. If you’re not really a technical person and this tutorial leaves you puzzled or does not answer all your questions I’d very much like to hear about it. Corrections and opinions are also welcome.

Some background

When you browse the web the situation is basically this: you sit at your computer and want to see a document somewhere on the web, to which you have the URL.

Since the document you want to read is somewhere else in the world and probably very far away from you some more details are needed to make it available to you. The first detail is your browser. You start it up and type the URL into it (at least you tell the browser somehow where you want to go, perhaps by clicking on a link).

However, the picture is still not complete, as the browser can’t read the document directly from the disk where it’s stored if that disk is on another continent. So for you to be able to read the document the computer that contains the document must run a web server. A web server is a just a computer program that listens for requests from browsers and then execute them.

So what happens next is that the browser contacts the server and requests that the server deliver the document to it. The server then gives a response which contains the document and the browser happily displays this to the user. The server also tells the browser what kind of document this is (HTML file, PDF file, ZIP file etc) and the browser then shows the document with the program it was configured to use for this kind of document.

The browser will display HTML documents directly, and if there are references to images, Java applets, sound clips etc in it and the browser has been set up to display these it will request these also from the servers on which they reside. (Usually the same server as the document, but not always.) It’s worth noting that these will be separate requests, and add additional load to the server and network. When the user follows another link the whole sequence starts anew.

These requests and responses are issued in a special language called HTTP, which is short for HyperText Transfer Protocol. What this article basically does is describe how this works. Other common protocols that work in similar ways are FTP and Gopher, but there are also protocols that work in completely different ways. None of these are covered here, sorry. (There is a link to some more details about FTP in the references.)

It’s worth noting that HTTP only defines what the browser and web server say to each other, not how they communicate. The actual work of moving bits and bytes back and forth across the network is done by TCP and IP, which are also used by FTP and Gopher (as well as most other internet protocols).

When you continue, note that any software program that does the same as a web browser (ie: retrieve documents from servers) is called a client in network terminology and a user agent in web terminology. Also note that the server is properly the server program, and not the computer on which the server is an application program. (Sometimes called the server machine.) Continue reading

filetool完美解决VC6.0与WIN7不兼容问题[转]

转自:http://alg.we2y.com/?p=65

上次自己在google上搜到过一次,但是这次解决又花了我一个小时,郁闷 ,这次一定要记录下来,Fuck.

今天打开VC6.0突然出现一个问题,不能点击“打开”,一点打开就出现错误,然后VC自动关闭,重新安装还是不行,我是win7系统,于是就想到可能是和系统不兼容造成的,毕竟6.0还是xp之前出来的,十几年了,但是不用不行啊,用习惯了,虽然TC比VC标准,但是这么多年都是VC,哎,不得不说微软有多恐怖啊。。。。好了,于是就从这个下手,去微软官网找补丁,没想到还真有补丁,微软网站描述的问题和我遇到的一样:

Access Violation (0xC0000005) in DEVSHL.DLL at 0×5003eaed.
DevShl.Dll referenced memory at 0×0000000. The memory could not be read.

出现这个错误,他们提供一个补丁filetool(点击直接下载),并提供解决步骤:

nstalling the Add-In

  1. Run FileTool.Exe to extract the Visual C++ 6.0 project.
  2. Build the project in Visual C++ in Release or Debug configuration.
  3. In Visual C++, click Customize from the Tools menu.
  4. In the Customize dialog box, click the Add-Ins and Macro Files tab.
  5. Click the Browse button and locate the FileTool.dll file that was built in step 2.
  6. Click OK to save the settings.

按照直接翻译的步骤估计是弄不好,不知道老外是怎么思考问题的…..

1.首先将下载的filetool这个文件解压,要学好路径,选在桌面就行了;

2.用VC6.0的打开工作空间(注意,一般情况下是打开不能用,但是打开工作空间还是可以用的),打开刚才解压的文件里面的Filetool.dsw文件,然后编译,在debug文件夹里面会出现一个Filetool.dll的库文件(其实就是微软给了你源代码然后让你自己编译生成需要的东西,不知道微软为什么不直接提供dll文件,可能是跟用户具体软件配置有关吧);

3.工具->定制->附加宏或宏文件选项卡,浏览,选择上一步生成的dll文件,然后打开,过上几秒钟这个宏就自动加进去了,然后关闭对话框,这时会看到界面上多了一个菜单条,A就是add file to project,O就是OPEN,代替原来相应的操作。

Office-中文字体对应的磅值

因为用英文office的原因,所以字号那里并没有几号字选项,只有英文中的磅值,所以放在这里mark一下,写论文的时候字号可别搞错了。:)

字号‘八号’对应磅值5
字号‘七号’对应磅值5.5
字号‘小六’对应磅值6.5
字号‘六号’对应磅值7.5
字号‘小五’对应磅值9
字号‘五号’对应磅值10.5
字号‘小四’对应磅值12
字号‘四号’对应磅值14
字号‘小三’对应磅值15
字号‘三号’对应磅值16
字号‘小二’对应磅值18
字号‘二号’对应磅值22
字号‘小一’对应磅值24
字号‘一号’对应磅值26
字号‘小初’对应磅值36
字号‘初号’对应磅值42

最土团购站数据库分析

ask – 提问表
card – 生成代金券
category – 类别: 城市列表、团购分类、论坛版面、用户等级、快递公司
coupon – 优惠券
feedback – 反馈
flow – 用户中心的资金流
friendlink – 友情链接
invite – 邀请
order – 订单表
paye – 页脚信息
partner – 商户表
pay –
smssubscribe – 短信订阅
subscribe – 邮件订阅
system – 系统设置 base64 encryption
team – 每日一团表
topic – 论坛发贴
user – 用户表