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

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


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

Secure PHP Development- P120

tailieu.vn

The $GLOBALS[‘argv’] argument is same as $argv , which holds the user- supplied command-line arguments. is added in the $CMD_SHORT_OPTIONS string to indicate that. The $CMD_LONG_OPTIONS is set to an array such as array(‘help’, ‘size. These arguments can be entered by the user as –help and --size=size. If an argument requires a parameter (like “s” in the listing above) you...

Secure PHP Development- P121

tailieu.vn

Listing 16-5: reminder.conf. Default: %USER_REMINDER_DIR%/reminders.txt define(USER_REMINDER_FILE, ‘reminders.txt’);. Listing 16-6 shows a sample configuration file for a user. Listing 16-6: ~username/reminders/reminders.txt. #daily:todo.txt. weekly:mon:monday_plans.txt. #weekly:tue:tuesday.txt weekly:tue:foo.txt. weekly:wed:wednesday_plans.txt weekly:fri:friday_prayer.txt. monthly:10:groupmtg10th.txt monthly:30:payroll.txt. Listing 16-6 (Continued) yearly txt yearly:07-22:ak_birthday.txt yearly:07-23:ak_birthday.txt. yearly:07-02:mk_birthday.txt yearly:07-03:mk_birthday.txt. daily:reminder_mail_file.txt. weekly:week_day:reminder_mail_file.txt monthly:MM:reminder_mail_file.txt yearly:MM-DD:reminder_mail_file.txt. Whenever such a line is processed by the reminder system, it reads the named file (reminder_mail_file.txt) and sends e-mail...

Secure PHP Development- P122

tailieu.vn

if (preg_match(‘/To:\s*(.+)/i’,. else if (preg_match(‘/From:\s*(.+)/i’,. array_push($headers, “From: $match[1] \r\n”);. else if (preg_match(‘/Subject:\s*(.+)/i’,. else if (preg_match(‘/^CC:\s*(.+)/i’, $str, $match)). array_push($headers, “Cc: $match[1] \r\n”);. else if (preg_match(‘/Bcc:\s*(.+)/i’, $str, $match)). array_push($headers, “Bcc: $match[1] \r\n”);. else if (preg_match(‘/Content-Type:\s*(.+)/i’,. if (preg_match(‘/html. array_push($headers,. else if (preg_match(‘/MIME-Version:\s*(.+)/i’,. array_push($message, $str);. $contentTypeSet) array_push($headers,. Ignore lines starting with # as comments if (preg_match. if (preg_match. if (preg_match(‘/daily/i’, $type)). array_push($reminders, $when);. else...

Secure PHP Development- P123

tailieu.vn

This function obtains four things: the user’s reminder directory ($userDir, which is USER_REMINDER_DIR set in reminder.conf), the user reminder file name ($userFile, which is USER_REMINDER_FILE set in reminder.conf), $username, and the user’s home directory ($homeDir).. It first determines whether the user has a reminder file in the reminder directory inside the user’s home directory. If there is no reminder configuration...

Secure PHP Development- P124

tailieu.vn

This script requires the netgeo.php class. ./geolocator.php www.yahoo.com www.yahoo.com: Approximate location:. You can see that www.yahoo.com appears to be located in Sunnyvale, CA, U.S.. $./geolocator.php www.amazon.com www.amazon.com:Approximate location:. In the preceding example, you can see that www.amazon.com appears to be located in Seattle, Washington, U.S.. $./geolocator.php www.csus.edu www.csus.edu: Approximate location:. You can see www.csus.com (California State University, Sacramento) appears to...

Secure PHP Development- P125

tailieu.vn

It requires the class.Linux.inc.php and common_functions.php. SIZE (from the hdmonitor.conf file).. The following disk(s) have exceeded set limit in hdmonitor.conf:. <tr>. <td>. <tr>. <td>. </td>. </tr>. <font color=”black”><%DISK_STATUS%>. </td>. <td colspan=2>. System Information </td></tr>. <td>Hostname </td><td>. <%HOST%></td></tr>. <td>IP Addr </td><td>. <%IP_ADDR%></td></tr>. <td>Kernel </td><td>. <%KERNEL%></td></tr>. The hdmonitor.php script contains the following functions.. This function sends an e-mail message by loading the...

Secure PHP Development- P126

tailieu.vn

alert condition for at least last 15 minutes. Mail every n seconds when alert condition exists. in a file so that we don’t mail bomb the. For example, alert condition RED is set to load average 25. Similarly, a load average of 15 triggers an alert condition YELLOW, and a load average of 5 triggers a BLUE alert.. Whenever an...

Secure PHP Development- P127

tailieu.vn

if (preg_match(‘/To:\s*(.+)/i’,. else if (preg_match(‘/From:\s*(.+)/i’,. array_push($headers, “From: $match[1] \r\n”);. else if (preg_match(‘/Subject:\s*(.+)/i’,. else if (preg_match(‘/^CC:\s*(.+)/i’,. else if (preg_match(‘/Bcc:\s*(.+)/i’,. else if (preg_match(‘/Content-Type:\s*(.+)/i’,. if (preg_match(‘/html. array_push($headers,. else if (preg_match(‘/MIME-Version:\s*(.+)/i’,. array_push($message, $str);. For each known alert condition, the script compares the current, 5-minute-old, and 15-minute-old loads against the alert condition’s maximum load average, stored in $alertRange . If the alert condition’s maximum load...

Secure PHP Development- P128

tailieu.vn

Apache Virtual Host Maker. Learning the basics of an Apache Virtual Host. Developing an Apache Virtual Host Maker. Configuring Apache for virtual hosts. Deploying virtual hosts using an Apache Virtual Host Maker. A PACHE IS THE MOST POPULAR Web server in the world. In this chapter, you will develop a command-line PHP script to help you manage Apache virtual hosts...

Secure PHP Development- P129

tailieu.vn

Create all the necessary Web and user account configurations and copy appropriate contents based on account type “gold.” In other words, all the. The makesite script uses the -type=account_type command-line argument to determine numerous tasks that need to be performed in the virtual host setup process. $ACCOUNT_TYPE[‘standard. ‘std_vhost.conf’, master_contents =>’std_contents.conf’, mail_template =>. ‘std_vhost.mail’, shell =>. $ACCOUNT_TYPE[‘gold. ‘gold_vhost.conf’, master_contents =>’gold_contents.conf’, mail_template...

Secure PHP Development- P130

tailieu.vn

Listing 17-2 (Continued). <Files “*.conf”>. ‘DOCUMENT_ROOT’ =>. When the std_vhost.conf file is loaded, the makeVirtualHost(). Listing 17-3 shows the contents configuration file, std_contents.conf, which is stored in the vhosts subdirectory pointed to by $TEMPLATE_DIR in makesite.conf.. Listing 17-3: vhosts/std_contents.conf. echo “$cmd\n”;. Listing 17-4 shows the e-mail template, which is also stored in the vhosts directory pointed to by the $TEMPLATE_DIR...

Secure PHP Development- P131

tailieu.vn

echo “Error: site test failed!\n”;. echo “Error: could not create symbolic link to site in user account!\n”;. echo “Error: could not add contents!\n”;. echo “Error: could not send mail!\n”;. echo “Enable named site \n”;. echo “Disable named site \n”;. echo “Creating user account: $user with password $pass shell=$shell\n”;. echo “Error: Password is missing or too short.\n”;. echo “Creating $vhost configuration\n”;....

Secure PHP Development- P132

tailieu.vn

$link = sprintf(“%s/%s/%s”, $GLOBALS[SYSTEM_INFO][home_dir],$user, $vhost);. $cmd = sprintf(“%s %s %s %s”, $GLOBALS[SYSTEM_INFO][symlink_bin],. echo “Creating symbolic link using $cmd\n”;. echo “Warning! Symlink: $link already exists.\n”;. echo “Error: could not make symbolic link: $cmd\n”;. $testFile = sprintf(“%s/test.txt”, $GLOBALS[SITE_INFO][DOCUMENT_ROOT]);. echo “Could not write test page in $GLOBALS[SITE_INFO][DOCUMENT_ROOT]. echo “Testing: requesting $url. echo “successful.\n”;. echo “failed.\n”;. $httpdConf = sprintf(“%s/%s/%s”, $GLOBALS[APACHE_INFO][path],. echo “Error: could not...

Secure PHP Development- P133

tailieu.vn

if (preg_match(‘/From:\s*(.+)/i’, $str, $match)). array_push($headers, “From: $match[1] \r\n”);. else if (preg_match(‘/Subject:\s*(.+)/i’, $str, $match)). else if (preg_match(‘/^CC:\s*(.+)/i’, $str, $match)). array_push($headers, “Cc: $match[1] \r\n”);. else if (preg_match(‘/Bcc:\s*(.+)/i’, $str, $match)). array_push($headers, “Bcc: $match[1] \r\n”);. else if (preg_match(‘/Content-Type:\s*(.+)/i’, $str, $match)). if (preg_match(‘/html. array_push($headers, “Content-Type: text/html\r\n”);. array_push($headers, “Content-Type: text/plain\n”);. else if (preg_match(‘/MIME-Version:\s*(.+)/i’, $str, $match)). array_push($headers, “MIME-Version: $match[1] \r\n”);. array_push($message, $str);. $contentTypeSet) array_push($headers, “Content-Type:. array_push($search, ‘/<....

Secure PHP Development- P134

tailieu.vn

The makesite.conf file has two path settings that are likely to differ from your system:. $PEAR_DIR = ‘/example/intranet/htdocs/pear’. ‘/usr/local/apache’,. Top Apache Directory: /usr/local/apache Apache Binary Directory: /usr/local/apache/bin. Apache Configuration Directory: /usr/local/apache/conf. Apache Virtual Host Configuration Directory: /usr/local/apache/conf/vhosts. You will have to create the virtual host configuration directory manually, as it is not standard in the Apache installer.. The www_partition should...

Secure PHP Development- P135

tailieu.vn

The makezone utility has the following features:. Here, makezone is instructed to add a new zone called example.com using the standard template.. Listing 18-1 shows the makezone.conf configuration file. This is the primary con- figuration file for the makezone script.. The makezone script uses the Console/Getopt.php package from the PEAR package. /etc/named.conf . The ZONE_DIR constant points to the standard...

Secure PHP Development- P136

tailieu.vn

ZONE_TEMPLATE_DIR constant in makezone.conf.. Listing 18-4: named.master_zone.conf. zone “$GLOBALS[ZONE]” IN { type master;. file “$GLOBALS[ZONE_FILE]”;. zone “example.com” IN { type master;. file “example.com.zone”;. This configuration is appended to /etc/named.conf. require_once(‘makezone.conf’);. echo “OK.\n”;

Secure PHP Development- P137

tailieu.vn

ZONE_TEMPLATE_DIR, ZONE_MASTER_TEMPLATE);. echo “Error: $file could. echo “Writing zone file ($file)....\n”;. echo “OK.\n”;. echo “Looking for zone file: $file. echo “not found\n”;. $file = sprintf(“%s/%s.template”, ZONE_TEMPLATE_DIR,. echo “Looking for zone template file: $file. Error in command line echo “$options->message \n”;. echo “$argName cannot have $argValue\n”;. This function adds a new zone in the DNS configuration. This variable stores the fully...

Secure PHP Development- P138

tailieu.vn

./makezone --add=zone --name=example.com --template=standard. This creates the /var/named/example.com.zone zone file for example.com using the standard zone template. $ORIGIN example.com.. www IN CNAME apache.example.com.. Master zone configuration for example.com. zone “example.com” IN { type master;. file “example.com.zone”;. dig www.example.com A. www.example.com A. ;www.example.com. www.example.com. example.com. 86400 IN NS ns.example.com.. dig example.com MX. dig example.com NS

Secure PHP Development- P139

tailieu.vn

Web Forms Manager. Developing a Web Forms Manager. Installing the Web Forms Manager. Using the Web Forms Manager. In this chapter, you will design a general-purpose Web Forms Management application that enables you to manage virtually any single-page Web form. The virtue of managing all your Web forms by using a central general-purpose Web forms application suite is that you...