« Home « Chủ đề Giới thiệu về MySQL

Chủ đề : Giới thiệu về MySQL


Có 160+ tài liệu thuộc chủ đề "Giới thiệu về MySQL"

Secure PHP Development- P140

tailieu.vn

This method determines whether the current IP is a part of the given network. It removes the fourth octet of the network IP (if it exists) and the current IP.. Each octet (three in total) of the current IP is matched with the octets of the network IP. The method returns TRUE if the match counter is exactly equal to...

Secure PHP Development- P141

tailieu.vn

This method determines whether the required fields for the form are provided. It uses the member variable $REQUIRED , which is set in the setupForm() method.. This method validates all the fields for the form. Then the method validate() of DataValidator is called, with type, size, and validation methods for each field of the form. The method returns TRUE if...

Secure PHP Development- P142

tailieu.vn

T ABLE 19-1 THE WEBFORMS.CONF VARIABLES THAT NEED TO BE CHANGED (Continued). $MAX_YEAR The maximum year to be used in the report prompt.. $MIN_YEAR The minimum year to be used in the report prompt.. $REPORTER The name of the application that manages the report.. $CSV_EXPORTER The name of the application that exports form data as CSV.. $DOWNLOAD_TRACK_TBL The name of...

Secure PHP Development- P143

tailieu.vn

This method authorizes the client IP in the following way:. Finally, the isAllowed() method of the ACL class is used to determine whether the client is allowed to access the application.. Creating the Web Forms Reporter Application. This application, webformsreporter.php , is responsible for showing the form report to the administrator. This application included is on the CD-ROM in the....

Secure PHP Development- P144

tailieu.vn

Create a database table in your WEBFORMS database using the name given ( FORM_TABLE ) in askform.conf . This table should have all the fields in your Web form and the ID and SUBMIT_TS fields. Make sure that you configure the rest of askform.conf to match your requirements. For example, to control access to your Web form via an IP...

Secure PHP Development- P144B

tailieu.vn

<form action=”/webforms/apps/submit.php” method=”POST”>. ?>”>. If we don’t enter all the required data and submit the form, the data entry dialog box shown in Figure 19-4 appears.. Figure 19-4: Data entry error dialog box.. After submitting valid data, submit.php shows the thank-you message shown in Figure 19-5. to/ask.php”>. submit.php can return you to the referring page.. Figure 19-5: Data validated and...

Secure PHP Development- P145

tailieu.vn

The vote application will have the following features:. An unlimited number of surveys/polls. An unlimited number of polling options. Figure 20-1 shows the VOTE database diagram for the voting tool. It holds the Poll ID ( POLL_ID. the vote value ( VOTE. and the submission timestamp of the vote ( VOTE_TS. Listing 20-1 shows an implementation of the VOTE database...

Secure PHP Development- P146

tailieu.vn

Finally, the number of votes is returned from this method.. Creating the Application Configuration Files. These files are discussed in the following sections.. The primary configuration file for the entire system is called vote.conf . T ABLE 20-1 VOTE.CONF VARIABLES Configuration Variable Purpose. $PEAR_DIR Set to the directory containing the PEAR package;. $PHPLIB_DIR Set to the PHPLIB directory, which contains...

Secure PHP Development- P147

tailieu.vn

Install the VOTE applications. apps/vote.conf for path and database settings. The applications are installed in the %DocumentRoot%/vote/apps directory, and the templates are stored in %DocumentRoot%/vote/apps/templates. For example, the vote.conf file has a MySQL database access URL such as the following:. Suppose, for example, that your database server is called db.domain.com , and that the username and password for accessing the...

Secure PHP Development- P149

tailieu.vn

echo ‘<p>Time elapsed. echo ‘<pre>’;. echo ‘</pre>’;. echo ‘<br>’;. echo ‘<. Store the output in a string array_push($output, ‘<

Secure PHP Development- P150

tailieu.vn

which runs each version of the function under benchmark conditions using the Benchmark/Iterate.php class for MAX_RUN times. This function receives an array as an argument and loops through each element of the array using a for loop. Notice that the loop uses the sizeof() function to deter- mine the size of the array. This degrades the speed of the loop...

Secure PHP Development- P151

tailieu.vn

Listing 21-5: compress.php. The following code highlights the extra HTTP headers that are sent when com- pression is enabled:. lynx -head -dump http://www.evoknow.com/ch21/gzip/compress.php. Server: Apache/2.0.43 (Unix) PHP/4.1.2 Date: Sat, 07 Dec GMT Connection: close. The same script without compression enabled sends the following headers:. The following sections discuss these caching techniques in detail.. Caching PHP contents using the jpcache cache....

Secure PHP Development- P152

tailieu.vn

echo $cache->end();. Listing 21-7 shows the new PEAR output–cached version of non_cached.php as pear_content_cache.php.. Listing 21-7: pear_content_cache.php. require_once ‘Cache/Output.php’;. array(‘cache_dir’ =>. $cache_id = $cache->generateID(. See if cached contents is available for the cache ID if ($content = $cache->start($cache_id)). write contents to cache file echo $cache->end();. http://server/path/to/pear_content_cache.php?nocache=1. PEAR’s cache package can also cache PHP function calls. Listing 21-8 shows a script...

Secure PHP Development- P153

tailieu.vn

Securing PHP Applications. Controlling access to your applications. Here I will discuss how you can con- trol access to your applications and related files, which is a big step in ensuring security. When you write applications there are various reasons for not allowing everyone access to your applications. This chapter will show you how to control access to applications that...

Secure PHP Development- P154

tailieu.vn

This means that the user’s password never travels over the network.. On the server side, you can use a PHP script to compare the user-supplied MD5 of a password with the user’s real password’s MD5 digest. Listing 22-1 shows a Web form with two JavaScripts. Listing 22-1: md5_login.html. <script language=”JavaScript” src=”md5.js”></script>. <script language=”JavaScript”>. document.loginForm.password.value = MD5(document.loginForm.password.value);. <form name=”loginForm” method=”post” action=”md5_login.php”>....

Secure PHP Development- P155

tailieu.vn

action=”bad_uploader.php”>. File: <input type=”file” name=”picfile”>. <input type=hidden name=”picfile_size” value=”1”>. A malicious hacker can easily create a Web form duplicating the bad_upload.html form, adding additional hidden fields, such as picfile_size=1 to populate the value for PHP’s automatic variable $picfile_size to bypass the size requirements. To prevent this problem, a better version of bad_uploader.php can be written as shown in Listing 22-6.....

Secure PHP Development- P156

tailieu.vn

What’s on the CD-ROM. T HIS APPENDIX CONTAINS INFORMATION about the contents of the CD that accompa- nies this book. For the latest and greatest information, please refer to the ReadMe file located at the root of the CD. What’s on the CD. If your computer doesn’t meet most of these requirements, you may have a problem using the contents...

Secure PHP Development- P157

tailieu.vn

$this->_CPU = $params[‘CPU’];. $this->_ROM = $params[‘ROM’];. $this->_RAM = $params[‘RAM’];. $this->_TYPE = $params[‘TYPE’];. Return CPU return $this->_CPU;. $this->_CPU = $cpu;. Return RAM return $this->_RAM;. $this->_RAM = $ram;. return $this->_TYPE;. $this->_TYPE = $type;. require_once ‘class.Computer.php’;. $this->getCPU. echo “RAM. $this->getRAM. $this->getType. This class simply creates a new method called printSpec() to print the computer’s specifications. $info[‘RAM. This enables the $info data to be...

Secure PHP Development- P158

tailieu.vn

Therefore, an application such as the following can use this class:. This will output the following:. Its popularity stems from the following:. If you’re in doubt about whether you fit within the license parameters, please see the Web site at http://www.mysql.com/. http://www.mysql.com/ and find a mirror site close to you. You can start the MySQL client program by typing the...