1. Trang chủ
  2. » Thể loại khác

Tung's Home Page

36 259 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Trường đại học vinh Trường đại học vinh khoa công nghệ thông tin khoa công nghệ thông tin Luận văn tốt nghiệp Đề tài: Tỡm hiu PHP( Personal Home Page) Thit k v xõy dng WebSite sinh vt cnh Giáo viên hướng dẫn: Th.s Lê Anh Ngọc Sinh viên thực hiện: Nguyễn Thị Huyền Trang Lớp 42E4 Giíi thiÖu Giíi thiÖu Hiện nay ở nước ta, đời sống kinh tế ngày càng phát triển, người ta càng có nhiều niềm đam mê và thú vui trong đó có thú vui chơi sinh vật cảnh. Họ cần những thông tin liên quan đến các loài như: cây cảnh, hoa cảnh và những con cá cảnh… Chưa kể đến họ còn muốn biết rõ hơn về cách trồng và chăm bón cây như thế nào? Cách nuôi loại cá đó ra làm sao? Kỹ thuật chăm sóc chậu hoa cảnh như thế nào là tốt nhất? Với những lý do đó họ cần đến những thông tin chính xá và bổ ích mang tính hỗ trợ của các chuyên gia. Bên cạnh những thông tin cần thiết về các loài mọi người còn cần biết về thị trường sinh vật cảnh qua đó họ có thể đến các địa chỉ trên để mua. Mặt khác các nhà vườn, các địa chỉ kinh doanh cũng muốn có một nơi để rao bán cac loài sinh vật cảnh nhằm quảng bá với khách hàng. Chính vì vậy việc tạo lập một Website với những thông tin đầy đủ liên quan đến những loài sinh vật mà họ muốn tìm hiểu và có ý định mua bán là việc cần thiết đối với mọi khách hàng. Sau khi tìm hiểu về ngôn ngữ PHP và cơ sở dữ liệu MySQL em dã áp dụng xây dựng “Website sinh vật cảnh” làm khoá luận tốt nghiệp. Néi dung b¸o c¸o Néi dung b¸o c¸o B¸o c¸o bao gåm c¸c phÇn nh­ sau: Chương1: Cơ sơ lý thuyết. Giới thiệu tổng quan về Internet. Lợi ích của Internet mang lại. Chương 2: Ngôn ngữ PHP và cơ sở dữ liệu MySQL Khái niệm về PHP Ngôn ngữ PHP Cơ sở dữ liệu MySQL Lêi c¶m ¬n Lêi c¶m ¬n Trước hết em xin chân thành cảm ơn thầy giáo Lê Anh Ngọc giảng viên khoa Công nghệ thông tin trường Đại Học Vinh đã tận tụy hướng dẫn giúp đỡ em trong suốt quá trình thực hiện luận văn tốt nghiệp. Cảm ơn cô giáo phản biện Phan Lê Na đã giúp đỡ em trong việc phản biện đề tài. Cuối cùng em xin chân thành cảm ơn các thầy cô giáo đã trực tiếp giảng dạy em trong những năm học vừa qua cùng bạn bè người thân đã nhiệt tình ủng hộ, động viên em trong suốt quá trình học tập và xây dựng luận văn tốt nghiệp. Chapter Database Recovery Techniques Adapted from the slides of “Fundamentals of Database Systems” (Elmasri et al., 2003) Outline Databases Recovery Purpose of Database Recovery Types of Failure Transaction Log Data Updates Data Caching Transaction Roll-back (Undo) and Roll-Forward Checkpointing Recovery schemes ARIES Recovery Scheme 10 Recovery in Multidatabase System Database Recovery Purpose of Database Recovery • • To bring the database into the last consistent state, which existed prior to the failure To preserve transaction properties (Atomicity, Consistency, Isolation and Durability) Example: If the system crashes before a fund transfer transaction completes its execution, then either one or both accounts may have incorrect value Thus, the database must be restored to the state before the transaction modified any of the accounts Database Recovery Types of Failure The database may become unavailable for use due to • Transaction failure: Transactions may fail because of incorrect input, deadlock, incorrect synchronization • System failure: System may fail because of addressing error, application error, operating system fault, RAM failure, etc • Media failure: Disk head crash, power disruption, etc Database Recovery Transaction Log For recovery from any type of failure data values prior to modification (BFIM - BeFore Image) and the new value after modification (AFIM – AFter Image) are required These values and other information are stored in a sequential file called Transaction log A sample log is given below Back P and Next P point to the previous and next log records of the same transaction T ID Back P Next P Operation Data item Begin T1 T1 Write X Begin T2 T1 W Y T1 R M T3 R N T1 nil End BFIM AFIM X = 100 X = 200 Y = 50 Y = 100 M = 200 M = 200 N = 400 N = 400 Database Recovery Data Update • Immediate Update: As soon as a data item is modified in cache, the disk copy is updated • Deferred Update: All modified data items in the cache are written either after a transaction ends its execution or after a fixed number of transactions have completed their execution • Shadow update: The modified version of a data item does not overwrite its disk copy but is written at a separate disk location • In-place update: The disk version of the data item is overwritten by the cache version • Immediate update and deferred update are two main techniques for recovery Database Recovery Data Caching Data items to be modified are first stored into database cache by the Cache Manager (CM) and after modification they are flushed (written) to the disk The flushing is controlled by Modified and Pin-Unpin bits Pin-Unpin: Instructs the operating system not to flush the data item Modified: Indicates the AFIM of the data item Database Recovery Transaction Roll-back (Undo) and Roll-Forward (Redo) To maintain atomicity, a transaction’s operations are redone or undone Undo: Restore all BFIMs on to disk (Remove all AFIMs) Redo: Restore all AFIMs on to disk Database recovery is achieved either by performing only Undos or only Redos or by a combination of the two These operations are recorded in the log as they happen Database Recovery Roll-back We show the process of roll-back with the help of the following three transactions T1, T2 and T3 T1 read_item (A) read_item (D) write_item (D) T2 read_item (B) write_item (B) read_item (D) write_item (D) T3 read_item (C) write_item (B) read_item (A) write_item (A) Database Recovery Roll-back: One execution of T1, T2 and T3 as recorded in the log A 30 [start_transaction, T3] [read_item, T3, C] * [write_item, T3, B, 15, 12] [start_transaction,T2] [read_item, T2, B] ** [write_item, T2, B, 12, 18] [start_transaction,T1] [read_item, T1, A] [read_item, T1, D] [write_item, T1, D, 20, 25] [read_item, T2, D] ** [write_item, T2, D, 25, 26] [read_item, T3, A] B 15 C 40 D 20 12 18 25 26 system crash -* T3 is rolled back because it did not reach its commit point ** T2 is rolled back because it reads the value of item B written by T3 10 Database Recovery Recovery Techniques Based on Immediate Update Undo/No-redo Algorithm In this algorithm AFIMs of a transaction are flushed to the database disk under WAL before it commits For this reason the recovery manager undoes all transactions during recovery No transaction is redone It is possible that a transaction might have completed execution and ready to commit but this transaction is also undone 22 Database Recovery Recovery Techniques Based on Immediate Update Undo/Redo Algorithm (Single-user environment) Recovery schemes of this category apply undo and also redo for recovery In a single-user environment no concurrency control is required but a log is maintained under WAL Note that at any time there will be one transaction in the system and it will be either in the commit table or in the active table The recovery manager performs: Undo of a transaction if it is in the active table Redo of a transaction if it is in the commit table 23 Database Recovery Recovery ... Đồ án tốt nghiệp Mục lục Mục lục Mục lục 1 Các thuật ngữ dùng trong đồ án 5 Phần 1 Thiết kế một Web site 11 Phần giới thiệu .12 Chơng 1. Các khái niệm cơ bản .14 I. Một trang Web là gì? 14 II. Một trang Home Page là gì? .15 III.Một Web site là gì? .16 IV. Ngôn ngữ HTML .18 V. Các Script là gì? 18 VI. Trình duyệt Web (Web Browser) .20 VII. Các URL (Uniform Resource Locator) .20 Khoa điện tử - Viễn thông- ĐHBKHN Trang 1 Đồ án tốt nghiệp Mục lục Chơng 2 Các công cụ cần có 22 I. Phía Server .22 I.1. Netscape Server 22 I.2. Internet Information Server Web Server .24 II. Phía client 24 II.1. Netscape Navigator .24 II.2. Trình duyệt Web Microsoft Internet Explorer 28 III. Phần mềm soạn các trang Web .29 Chơng 3 Thiết kế một Web site 30 Lời giới thiệu 30 Các yếu tố cơ bản và mục đích của việc thiết kế một Web site 33 I. Cấu trúc một trang Web .34 II. Liên kết các trang lại với nhau 35 III. Các phơng pháp thiết kế một Web site 38 III.1. Phơng pháp từ trên xuống dới .38 III.2. Phơng pháp thiết kế từ dới lên 38 III.3. Phơng pháp thiết kế lớn dần/khi cần thiết .39 IV. Các kỹ thuật thiết kế 39 IV.1. Tổ chức thông tin thành từng nhóm có kích thớc hợp lý .40 V. Các vấn đề khi thiết kế một Web site 40 V.1. Trang đến từ bên ngoài (page from outer space) 41 V.2. Trang Web khổng lồ (Monster Page) .42 V.3. Dùng các công cụ đa phơng tiện quá mức cần thiết 43 V.4. Trang Web không có cấu trúc 43 V.5. Các liên kết vô nghĩa .44 Chơng 4 Các ứng dụng cơ bản của Web .45 I. Web với thơng mại .45 I.1. Quảng cáo trên Web .45 I.2. Mua bán hàng hoá trên Web .45 I.3. Thanh toán và mở tài khoản với ngân hàng qua Web .46 II. Web với vui chơi và giải trí và nghệ thuật .46 III. Web với giáo dục và nghiên cứu .46 III.1. Web thúc đẩy học sinh học tập tốt hơn .46 III.2. Các trờng học trên Web 46 IV. Web với khoa học và công nghệ .46 Phần 2 Giới thiệu Java và cơ sở dữ liệu 47 Khoa điện tử - Viễn thông- ĐHBKHN Trang 2 Đồ án tốt nghiệp COMPUTER LEARNING CENTER WWW.HUUKHANG.COM Môn học: PHP Bài 1 Những vấn đề chính sẽ được đề cập trong bài học: 9 Giới thiệu PHP 9 Cấu hình IIS, Apache Web Server 9 Cài đặt PHP. o Cài đặt PHP. o Cấu hình ứng dụng PHP 9 Giới thiệu PHP. o PHP Script. o Ghi chú trong PHP o In nội dung bằng PHP 1. GIỚI THIỆU PHP PHP viết tắt của chữ Personal Home Page ra đời năm 1994 do phát minh của Rasmus Lerdorf, và nó tiếp tục được phát triển bởi nhiều cá nhân và tập thể khác, do đó PHP được xem như một sản phẩm của mã nguồn mở. PHP là kòch bản trình chủ (server script) chạy trên phía server (server side) như cách server script khác (asp, jsp, cold fusion). PHP là kòch bản cho phép chúng ta xây dựng ứng dụng web trên mạng internet hay intranet tương tác với mọi cơ sở dữ liệu như mySQL, PostgreSQL, Oracle, SQL Server và Access. Lưu ý rằng, từ phiên bản 4.0 trở về sau mới hỗ trợ session, ngoài ra PHP cũng như Perl là kòch bảng xử lý chuỗi rất mạnh chính vì vậy bạn có thể sử dụng PHP trong những có yêu cầu về xử lý chuỗi. 2. CÀI ĐẶT PHP Cài đặt PHP trên nền Windows thì sử dụng php-4.0.6-Win32.zip, sau khi cài đặt ứng dụng này trên đóa cứng sẽ xuất hiện thư mục PHP, trong thự mục này sẽ có tập tin php4ts.dll và php.exe cùng với thư mục sessiondata. Ngoài ra, trong thư mục WINDOW hoặc WINNT sẽ xuất hiện tập tin php.ini, tập tin này cho phép bạn cấu hình cho ứng dụng PHP. Chẳng hạn, khi sử dụng session, PHP cần một nơi để lưu trữ chúng, trong tập tin này mặc đònh là session.save_path = C:\PHP\sessiondata, nếu bạn cài đặt PHP với thư mục PHP trên đóa D thì bạn cần thay đổi đường dẫn trong khai báo này. Tương tự như vậy, khi có lỗi trong trangPHP thì lỗi thường xuất hiện khi triệu gọi chúng, để che dấu các lỗi này thì bạn cần khai báo display_errors = Off thay vì chúng ở trạng thái display_errors = On. Ngoài ra, trang PHP cũng có thể trình bày một số warning khi chúng phát hiện cú pháp không hợp lý, chính vì vậy để che dấu các warning này thì bạn cũng cần khai báo trạng thái Off thay vì On như assert.warning = Off. 3. CẤU HÌNH ỨNG DỤNG PHP 3.1. Cấu hình IIS Sau khi cài đặt hệ điều hành Windows NT hay 2000 trở về sau, bằng cách khai báo mới một web site hay virtual site trong một site đang có theo các bước như sau: 1. Tạo một thư mục có tên myPHP đề lưu trữ các tập tin PHP 2. Khởi động IIS (tự động khởi động nếu Windows NT/2000) Giáo viên: Phạm Hữu Khang COMPUTER LEARNING CENTER WWW.HUUKHANG.COM 3. Chọn Start | Programs | Administrative Tools | Internet Information Server 4. Nếu tạo virtual site thì chọn Default Web Ste | R-Click | New | Virtual Site 5. Trong trường hợp tạo mới Site thì Default Web Ste | R-Click | New | Site 6. Nếu chọn trường hợp 4 thì bạn cung tấp diễn giải của site như hình 1-1 Hình 1-1: Khai báo diễn giải 7. Chọn nút Next và khai báo IP và port, trong trường hợp bạn không sử dụng port 80 cho ứng site khác thì chọn giá trò mặc đònh. Tuy nhiên nếu có nhiều ứng dụng trước đó đã cấu hình trong IIS thì bạn có thể thay đổi port khác, ví dụ chọn port 85 như hình 1-2. Hình 1-2: Khai báo IP và Port Lưu ý rằng, port 80 là port chuẩn điều này có nghóa là khi triệu gọi trên trình duyệt bạn không cần gõ port, ví dụ http://localhost/. Đối với trường hợp port khác thì bạn phải gõ tương tự như http://localhost:85/ Giáo viên: Phạm Hữu Khang COMPUTER LEARNING CENTER WWW.HUUKHANG.COM 8. Chọn Next, bạn chọn thư mục của ứng dụng, đối với trường hợp này chúng ta chọn vào thư mục myPHP, chẳng hạn trong trường hợp này chúng ta chọn htư mục myPHP như hình 1-3. Hình 1-3: Chọn thư mục myPHP 9. Kế đến chọn quyền truy cập web site, trong trường hợp đang thiết kế thì bạn chọn vào Browse. Ngoài ra, nếu bạn cho phép người sử dụng internet có thể thực thi tập tin thực thi từ xa thì chọn vào tuỳ chọn execute. Hình 1-4: Quyền truy cập 10.Chọn Next và Finish, trong cửa sổ IIS xuất hiện ứng dụng có tên myPHP (khai báo trong phần diễn giải) như hình 1-5. Giáo viên: Phạm Hữu Khang COMPUTER LEARNING CENTER WWW.HUUKHANG.COM Hình 1-5: Tạo Book 1: Chapter 1 Search WWW Search neo-tech.com NT Home Page Book 1 Neo-Tech Home Page The Ultimate Leverage for Riches Next Page | Contents | Feedback for Valuable/New Information | Previous Page The Book by Mark Hamilton Book One Foreword In Book One you will learn about the supersociety and the almost unbelievable life that is in store for you within just a few years. Chapter One treats you to an immediate rush of personal discoveries and monetary advantages. Chapter Two delivers important insights about your past and future. Chapters Three through Six reveal the supersociety and show you how to be among the first to enter it. Table of Contents Foreword i 1 You Will Become the God-Man http://www.neo-tech.com/book1/ (1 of 25) [2/8/2003 3:24:13 PM] Google Search Book 1: Chapter 1 1 2 The Beginnings 15 3 From Anticivilization to Civilization of the Universe 47 4 Forces of Nature Versus Forces of Neothink 55 5 The Civilization of the Universe Starts on Earth 61 6 See Zon With Your Own Eyes 65 Chapter 1 You Will Become the God-Man Are you looking for immediate results? The Book is built upon a spiral of techniques and ideas. You must start at the beginning and read to the end. If you do, you will have the tools to make man's final evolution into a superior being called the God-Man. The God-Man enjoys Six Ultimate Gifts: profound security, perfect health, millionaire wealth, an exhilarating livelihood, rare romantic love, and superior intelligence called Neothink. "But," you may be thinking, "to read The Book and become the God-Man seems overwhelming and would take such a long time." To help you get started on this journey immediately, I pulled Chapter Eleven from Book Three titled You Will Become the God-Man and moved it right here, over the next 12 pages. This chapter will give you immediate results so you can start your adventure toward the prosperous God-Man tomorrow morning, bringing you instant energy, enthusiasm, and payoffs as you discover the life you were http://www.neo-tech.com/book1/ (2 of 25) [2/8/2003 3:24:13 PM] Book 1: Chapter 1 meant to live. Before you begin, however, let me ask you: how much is it worth to you to discover what you would have done best in life? $250, $500, $1000? I know I would pay five-hundred dollars to know. Over the next 12 pages, you have the opportunity to see, via the proven Neo-Tech techniques, your best path in life. It will cost you an hour of your time to read those pages that open the door to the life you were meant to live. Some people just like to know, out of curiosity, what they would have done best in life. But, even more go on to travel that life they were meant to live and become deeply happy and motivated, wealthy and powerful, and discover rare romantic love. Men and women are equally invited to take the adventure. When you have finished reading the next 12 pages, as prosperous as those pages were, remember that your exciting journey will just be starting. Therefore, let us begin. Five of the six gifts of the God-Man can start filling your life as early as tomorrow morning. The gift of perfect health still relies on the Technological Revolution. But you do not have to wait for the other gifts of profound security, millionaire wealth, a dream career, a dream lover, and superior intelligence. Follow the step-by-step instructions in this chapter to open the door to the life you were meant to live. Opening the Door to the Person You Were Meant to Be What motivates you into making the ... illustrated below Here a page is a data item Current Directory Database disk blocks (pages) (after updating pages 2, 5) Page (old) Page Page Page (old) Page Page 6 Page (new) Page (new) Shadow Directory... following additional information is logged: Page ID for the page that includes the item Length of the updated item Its offset from the beginning of the page BFIM of the item AFIM of the item 30... log record it is associated with In addition, each data page stores the LSN of the latest log record corresponding to a change for that page A log record stores (a) the previous LSN of that transaction,

Ngày đăng: 03/11/2017, 16:57

Xem thêm

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN