1. Prevent jumping out of the web directory
First modify the httpd.conf, if you only allow your PHP script to operate in the Web directory, but also can modify the httpd.conf document limit PHP operation path. For example, if your web directory
Copy CodeThe code is as follows:
$sourceNumber = "1";
$newNumber = substr (Strval ($sourceNumber +1000), 1, 3);
echo "$newNumber";
?>
This time it will appear: 001
If you want to increase the number of digits, you can increase the 1000 and then
This article shows you how to use PHP to build an object-oriented graphics layer. Using an object-oriented system can be used to build complex graphics, which is much simpler to build than using the basic functionality provided in a standard PHP
Always forget a sentence to put in which file, directly all kill ...
Copy CodeThe code is as follows:
if (!isset ($dir) or empty ($dir)) {
$dir =str_replace (' \ \ ', '/', dirname (__file__));
echo "". $dir. "";
} else {
$dir =$_get[' dir '];
echo
Table One: admin
Field: ID (int11) name (VARCHVR) password (VARCHVR)
Table II: LO
Field: ID (int11) Username (VARCHVR) Sex (VARCHVR) QQ (VARCHVR) Email (VARCHVR) info (text) IP (VARCHVR) submit_time (datetime)
1. conn.php (connect database
Why do you think about using vs2005?
The first is the power of the VS development. NET application, or ASP. I've always missed it.
The second is that VS is a very comprehensive editor, even the pictures can be opened directly to the editor, for
From: http://bbs.phome.net/ShowThread/?threadid=9247&forumid=2
In PHP programming, we often encounter some functions that produce output directly, such as PassThru (), ReadFile (), Var_dump (), and so on. But sometimes we want to import the output
This article mainly introduces the PHP simple socket Server Client code example, this article gives two versions of the server port, the code of the problem and improvements are described, and the use of this socket server client code, the need for
Copy CodeThe code is as follows:
/*
mysql_pager.class.php
Three parameters. mysql_query () result, URL variable page, number of records per page you want
Example at the bottom of this file
Freshwater River side Finishing test
*/
Class Mysql_pager
Copy CodeThe code is as follows:
Class TEST
{
Const NAME = ' value '; Constant
Public $name = ' value '; Property
Public Function name ()//method
{
echo ' value ';
}
}
?>
In this context, attributes and methods can be used to further
Note: This is the code specification from the PHPCMS development documentation, although it is known as the development specification for PHPCMS, but I think all PHP programming is the same. Write so much php, a lot of coding compared to this
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.
2. The speed of $row [' ID '] is 7 times times that of $row[id].
3. Echo is faster than print, and
1. Why does PHP choose MySQL as a database?
2. mysql Database creation user
This article mainly writes the difference that the MySQL creates the user's statement, turns from the Isher the Blogspot, because in the writing thought why does not
The Wamp installed on your own computer, when the import database is larger (greater than 2M) encountered an error, cannot be imported.
Find a workaround:
There are three places in the php.ini configuration file that need to be changed:
Converts the character of an IP-point address back to the IP V4 format address
int Ip2long (string ip_address)
A string that converts an IP V4 format address back to an IP point sub-address
String Long2ip (int proper_address)
Gets the environment
Send an e-mail to the specified email address to,subject represents the subject, and the message is the content of the letter. Additional options additional_headers can be omitted, indicating the header of other mail documents
BOOL Mail (string
There are two ways I know now, one is to use the APC extension (HTTP://PECL.PHP.NET/PACKAGE/APC) written by the founder of Php Rasmus Lerdorf, and the other is to use the PECL extension module Uploadprogress implementation
I send the code all for my original, and applied in a number of projects. I often use php+mysql pagination code
Copy CodeThe code is as follows:
$perpagenum = 10;//definition shows several pages per page
$total = Mysql_fetch_array (mysql_query
First, the basic principle
Consider intercepting PHP to read the source file interface. At first, I considered processing from the interface between Apache and PHP, see Apache's src/modules/php4/mod_php4.c (this is the file that PHP compiles into
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