If you want to implement password protection on a per-script basis, you can create a basic authentication mechanism by combining the header () function with the $php_auth_user, $PHP _AUTH_PW global variables. Typically the server-based
Everyone is very convenient to use précis-writers domain name such as yourname.yeah.net, a lot of people think: if I can make my server can also implement précis-writers domain name is good. Actually, it's not complicated. After reading this article,
Parse error:syntax error, unexpected $end in script.php on line xx
After debugging for a while, found that the line that produced the error is a row in the middle of the file
$str. = ">\n";
Think of it. The end tag allowed by the PHP interpreter
1. Create a new database:
After entering the phpMyAdmin management interface, find the following text "Create a new Database", then fill in the name of the database to be created below, select the encoding of the database in the drop-down list, such
The float type can be represented in the following ways:
Copy CodeThe code is as follows:
$a = 1.234;
$b = 1.2e3;
$c = 7E-10;
?>
The type of float used in PHP needs to be noted: the accuracy of the float type of PHP is somewhat problematic. If
5. How to instantiate an object
As we said above, object-oriented programs are objects, but objects are instantiated by class, since
Our class will declare that the next step is to instantiate the object.
When a class is defined, we use the New
1. Can read random string
This code creates a readable string that is closer to the word in the dictionary, and is practical and has password validation capabilities.
Copy CodeThe code is as follows:
/**************
* @length-length of random
For Apache rewrite module opening and setting is not the subject of this article, please see the other articles in detail.
This class can only be used by PHP 5.30 or more, inheriting the features of the fast redirection of the previous version
1, mucms a small, platform-independent content management system for non-interactive sites (the site only publishes information). It is very low on system requirements and requires only apache+php. The database is not being used. It is safe, fast,
Copy CodeThe code is as follows:
/*
MYSQL Database Access wrapper class
MYSQL data access mode, PHP4 supports process access starting with Mysql_, PHP5 start supporting processes that begin with Mysqli_ and mysqli object-oriented
Access mode, this
What is Snoopy? (Download Snoopy)
Snoopy is a PHP class that mimics the functionality of a Web browser, which accomplishes the task of getting web content and sending forms.
Some features of Snoopy:
* Easy to crawl the content of the webpage
* Easy
Object-oriented approach
Let's take a look at the error handling of the PDO in PHP, if the connection error is handled, using an object-oriented approach:
Copy CodeThe code is as follows:
try {
$db = new PDO (' Mysql:host=localhost;dbname=test ', $
PHP handling of case-sensitive issues is messy, writing code may occasionally problem, so here to summarize.
But I'm not encouraging you to use these rules. We recommend that you always adhere to the "case sensitive" and follow the Uniform Code
Recently, when looking at a cow's code, see a very useful function: Extract (), its main function is to expand the array, the key name as the variable name, the element value is the variable value, you can say that the operation of the array
Simple Factory mode:
① abstract base class: Some methods of defining abstractions in classes to implement in subclasses
② inherits from the subclass of the abstract base class: Implementing an abstract method in a base class
③ Factory class: Used to
GPC filtering, automatic escape of special characters in $_get,$_post,$_cookie to prevent SQL injection attacks
$_get = Saddslashes ($_get);
$_post = Saddslashes ($_post);
Copy CodeThe code is as follows:
The following is an example of daddslashes (
When we search for something, we often meet the goal of entering multiple conditions by separating them with spaces. Today, when this happens in the project, we write a function that puts multiple conditions into the array. Currently support space,
When the Windows Server opens the PHP GD library, the results of phpinfo () after using CGI do not appear gd in the Configure Command.
Configure Command is displayed after theIs:
Copy CodeThe code is as follows:
1 Cscript/nologo configure.js
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service