Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 513 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
513
Dung lượng
4,66 MB
Nội dung
[...]... the surface The tip isn’t actually embedded in the web page at all, but it is stored in a completely separate file The program integrates this separate file into the HTML page The page owner can change the tip of the day very easily by editing the text file that contains the tips IN THE REAL WORLD The Tip of the Day page illustrates one of the hottest concepts in web programming today: the content... host web pages and other information They are much like the drive-through restaurant Users drive up to the web server using a web browser The data is exchanged and the user can read the information on the web browser What’s interesting about this model is the interaction doesn’t have to stop there Since the client (user’s) machine is a computer, it can be given instructions Commonly, the JavaScript language... File 209 xii PHP 6 /MySQL Programming fortheAbsoluteBeginner Closing a File 209 Loading a File from the Drive System 210 Introducing the loadSonnet.php Program 210 Beautifying Output with CSS 211 Using the “r” Access Modifier 212 Checking forthe End of the File with feof() 212 Reading Data from the File with fgets() 212... things they can do A client-side web program usually cannot access the user’s 4 PHP 6 /MySQL ProgrammingfortheAbsoluteBeginner printer or disk drives This limitation alone prevents such programs from doing much of the most useful work of the Internet, such as database connectivity and user tracking The server is also a computer; it’s possible to write programs designed to operate on the server rather... includes the following features: • Apache web server • PHP programming language • MySQL relational data manager • PHPMyAdmin database management package • Mercury Mail email server • A control panel application that helps you configure and run the software • Some additional languages and packages 8 PHP 6 /MySQL Programming fortheAbsoluteBeginner There are versions of XAMPP available for all major platforms... Security Settings There is a security link on the main XAMPP page Use this link to investigate the current security settings of your server Figure 1.4 shows this in process FIGURE 1.4 Checking the security of the server 10 PHP 6 /MySQL Programming fortheAbsoluteBeginner You can have XAMPP fix two common security problems automatically by using the provided link This allows you to change the default password... Creating the Query Form 433 Including the dbLib Library 434 Connecting to the spy Database 435 Retrieving the Queries 435 Creating the Edit Table Form 435 Building the viewQuery.php Program 436 Viewing the editTable.php Program 439 Viewing the editRecord.php Program 440 Viewing the updateRecord.php Program 441 Viewing the. .. web page These instructions (like the HTML code itself) don’t mean anything on the server Once the page gets to the client machine, the browser interprets the HTML code and any other JavaScript instructions While much of the work is passed to the client, there are some disadvantages to this clientside approach Programs designed to work inside a web browser are usually greatly restricted in the kinds... illustrates the Tip of the Day page, which offers friendly, helpful advice 2 PHP 6 /MySQL Programming fortheAbsoluteBeginner FIGURE 1.1 The tip of the day might look simple, but it is a technological marvel It features HTML, cascading style sheets, and PHP code You could write this kind of page without using a technology like PHP, but the program is a little more sophisticated than it might look on the. ..x PHP 6 /MySQL Programming fortheAbsoluteBeginner Using Arrays in Forms 121 Arranging an HTML Form to Create an Array 124 Reading an Array from a Form 125 Keeping Persistent Data 126 Counting with Form Fields 127 Storing Data in the Text Box 129 Using a Hidden Field for Persistence 130 Using a Session . Structure to Simplify Programming 72 Building the Switch Dice Program 73 Using the switch Structure 74 PHP 6 /MySQL Programming for the Absolute Beginner viii Combining a Form and Its Results 75 Responding. Multidimensional Array 163 Building the HTML for the Basic Multidimensional Array 165 Responding to the Distance Query 166 PHP 6 /MySQL Programming for the Absolute Beginner x Making a Two-Dimensional. 355 Changing Data with the UPDATE Statement 356 Returning to the Adventure Game 356 Designing the Data Structure 357 Summary 359 PHP 6 /MySQL Programming for the Absolute Beginner xiv Connecting