tailieunhanh - Web Server Programming phần 5

Chương trình này sẽ không chính xác quá trình thẻ HTML được mở trên một dòng và đóng cửa trên một dòng tiếp theo. (4) Rà soát các chương trình từ tập 3 để đọc các tập tin đầu vào toàn bộ vào bộ nhớ và xử lý nội dung của nó như là một chuỗi dài. | 238 PHP4 Imagestring image 2 x1 y-10 fullname text_color if value 0 ImageString image 2 x2 y-10 Who text_color else scaled value 600 max scaled integer scaled imagefilledrectangle image x2 y-12 x2 scaled y 2 fill_color ImageLine image 0 y 4 imagewidth y 4 black y 20 Save the image to file imagepng image tempfile imagedestroy image State Section contained an example illustrating how the hiding of previously submitted data in subsequently generated dynamic form pages can preserve client state. That scheme works in part but it is only really useful if you are working through a fixed sequence of forms all of which must be completed in a specific order. There are many other situations where it is useful to maintain some representation of client state even though the client is going to be moving around following different links to various parts of your web site. Consider for instance a web site where you want to include advertisements in the banner portion of the pages that you return most of these pages being essentially static information. Your client will be following arbitrary links amongst your pages but you would still like to save client state - if simply something like a record of the advertisements that the client has already seen so that you can show other products. But you don t have any forms and there are no form submission actions that you could rely on to return hidden field data. Persistent state client side cookies are the basis of an alternative mechanism for preserving state. Cookies are Small blocks of data created in the server Sent to the client in the HTTP header portion of a response Saved by the client s browser Returned to your server in the HTTP header portion of subsequent requests State 239 The rules for cookies permit a server to create up to twenty distinct cookies associated with a particular resource with each individual cookie having up to 4 kbyte of data. Each cookie can have Data The data take the form of name value pair s . An

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.