« Home « Chủ đề Professional Information Technology Book

Chủ đề : Professional Information Technology Book


Có 100+ tài liệu thuộc chủ đề "Professional Information Technology Book"

Professional Information Technology-Programming Book part 81

tailieu.vn

To read the contents of a file into a string variable, you use. The following statement reads a file called file.txt into the variable $data. $data = file_get_contents("file.txt");. The following statement writes the value of $data to file.txt. file_put_contents("file.txt", $data);. The arguments to fopen are a filename and the mode in which to open the file. r Opens for reading...

Professional Information Technology-Programming Book part 82

tailieu.vn

Let's look at them in the following sections.. The following is a simple example that works on both Unix/Linux and Windows systems:. The command hostname is executed on the host system, and its output is. stream if you want to see warnings and errors produced by the host command.. The following example makes a system call to the hostname command...

Professional Information Technology-Programming Book part 83

tailieu.vn

you will learn how you can use PHP's Safe Mode to place restrictions on host program execution.. Consider the script in Listing 18.2, which creates a web form interface to the finger command.. To make Listing 18.2 safe, the statement that builds $cmd should be changed to the following:. Now, entering ;ls into the form will result in the command...

Professional Information Technology-Programming Book part 84

tailieu.vn

In the following sections you will find out how to make the most of MySQL's error reporting to debug errors at the database level.. You should check the return value from mysql_query to determine whether there was a problemit is NULL if the query has failed for any reason. The following example tries to perform an invalid SQL statement (the...

Professional Information Technology-Programming Book part 85

tailieu.vn

By using database abstraction, you can write database-driven code that should be able to work with a multitude of back ends, simply by changing the DSN used to connect to the database.. The most important consideration is to make sure that your SQL is written for the lowest common subset of the SQL language available to all the database back...

Professional Information Technology-Programming Book part 86

tailieu.vn

Writing Scripts for the Command Line. You will rarely, if ever, use these features in the web environment, but they are described in the following sections.. tag to produce a simple line break in the output. When it is sent to a web page, the newline character, \n, causes a line break in the HTML source, but it is not...

Professional Information Technology-Programming Book part 87

tailieu.vn

Error Reporting. PHP has a configurable error reporting system that you can set to be just as. To change the error reporting level, you use the error_reporting function with a value that is made up of the constants shown in Table 22.1.. Error Reporting Constants. To set the error reporting level so that all warnings and notices are displayed, you...

Professional Information Technology-Programming Book part 88

tailieu.vn

In this lesson you have learned how to detect and handle errors in PHP scripts. In the next lesson you will learn about the various PHP settings that you can. In this lesson you will learn how to configure global PHP settings at runtime, using the php.ini file, and per-directory settings, using .htaccess.. These directives can be global for your...

Professional Information Technology-Programming Book part 89

tailieu.vn

You use the dl function to dynamically load an extension module. For instance, running the following. The argument given to dl is the filename of the extension. In the case of the sockets extension, it would be called sockets.so on Linux/Unix but php_sockets.dll on Windows systems.. To check whether an extension is loaded into PHP, you use the. If you...

Professional Information Technology-Programming Book part 90

tailieu.vn

You can use the expose_php directive in php.ini to prevent the presence of PHP being reported by the web server, as follows:. By using this setting, you can discourage automated scripts from trying to attack your web server. Usually, the HTTP headers contain a line that looks like the following:. If you want to use a totally different file extension,...

Professional Information Technology-Programming Book part 91

tailieu.vn

PEAR is made up of the following:. The PEAR Coding Standards (PCS). Online support for the PEAR community through a website and mailing list The PEAR Code Library. You use the PEAR installer, which is shipped with PHP, to automatically. You will learn how to use the PEAR installer later in this lesson.. PEAR packages are registered in a central...

Professional Information Technology-Programming Book part 92

tailieu.vn

These instructions take you through installing PHP from source, using an Apache web server. You should become the root user to perform the installation by issuing the su command and entering the superuser password.. If you already have installed an Apache web server that supports dynamic shared objects (DSO), you can skip this section. To check whether your web server...

Professional Information Technology-Programming Book part 93

tailieu.vn

Sams Teach Yourself Regular Expressions in 10 Minutes By Ben Forta. The reader of this book will learn how to:. Use all of the special characters. Sams Teach Yourself Regular Expressions in 10 Minutes is a tutorial book organized into a series of easy-to-follow 10-minute lessons. scenarios, this book takes a very hands-on approach to solving the needs of the...

Professional Information Technology-Programming Book part 94

tailieu.vn

Who Is Sams Teach Yourself Regular Expressions For?. You are new to regular expressions.. You want to quickly learn how to get the most out of the regular expression language.. You use Perl, ASP, Visual Basic, .NET, C#, Java, JSP, PHP, ColdFusion (and many other languages), and you want to learn how to use regular expressions within your own application...

Professional Information Technology-Programming Book part 95

tailieu.vn

and can be immensely useful in experimenting with regular expressions quickly and easily.. There is rarely a right or wrong solution when writing regular expressions (as long as your solution works, of course).. As with any language, the key to learning regular expressions is practice, practice, practice.. Regular expressions are one of the most powerful tools available for text manipulation....

Professional Information Technology-Programming Book part 96

tailieu.vn

sales.xls sales1.xls orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls na1.xls na2.xls sa1.xls. sales.xls sales1.xls orders3.xls sales2.xls. sales3.xls apac1.xls europe2.xls na1.xls na2.xls sa1.xls. This example contains one additional file, sales.xls. sales1.xls orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls na1.xls. na2.xls sa1.xls. sales1.xls orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls na1.xls na2.xls sa1.xls. sales1.xls. orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls na1.xls na2.xls sa1.xls. Canadian sales data) named ca1.xls as...

Professional Information Technology-Programming Book part 97

tailieu.vn

europe2.xls sam.xls na1.xls na2.xls sa1.xls ca1.xls. sales1.xls orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls sam.xls na1.xls na2.xls sa1.xls ca1.xls. Notice that file sam.xls was not matched, because m did not match the list of allowed characters (the 10 digits).. sales1.xls orders3.xls sales2.xls sales3.xls apac1.xls europe2.xls. sam.xls na1.xls na2.xls sa1.xls ca1.xls. As such, [ns]a[^0-9]\.xls matches sam.xls but not na1.xls, na2.xls, or sa1.xls.

Professional Information Technology-Programming Book part 98

tailieu.vn

In this lesson you'll learn about additional metacharacters used to match specific characters or character types. it is used to match any single character (as explained in Lesson 2). it is used to mark the beginning of a set (as explained in Lesson 3,. expressions, these characters cannot be used to refer to themselves. For example, you cannot use a...

Professional Information Technology-Programming Book part 99

tailieu.vn

Ben","Forta". Jim","James". Roberta","Robertson". Bob","Bobson". \r\n matches a carriage return line feed combination, used (by Windows) as an end- of-line marker. Searching for \r\n\r\n therefore matches two end-of-line markers, and thus the blank line in between two records.. I just stated that \r\n is used by Windows as an end-of-line marker.. On those system, you'll probably just want to use \n...

Professional Information Technology-Programming Book part 100

tailieu.vn

These shortcut metacharacters and POSIX classes may be used to simplify regular expression patterns.. Consider what it would take to write a regular expression to match an email address. Using the metacharacters discussed in the previous lesson, you could create a regular expression like the following:. Matching One or More Characters. To match one or more instances of a character...