I'm used to setting the log path is this/home/www/logs/domain name. logLike what/home/www/logs/www.yundaiwei.com.log
For ease of administration, logs need to be kept in one file by day and a log of the specified number of days, which is deleted
Example 1
The code is as follows
Copy Code
/** How to prevent duplicate submission of forms in PHP*/Session_Start ();if (Empty ($_session[' IP ')) {//First write to determine whether the IP address is logged, to know
The main consideration is to QQ PHP SDK write is really rotten, is a universal API knowledge, rather than hand can deploy class library. Anyway, I wrote one, and I took it out to share.
Nothing more to say, directly on the code.
qq_sdk.php
When someone wants to implement concurrency, they usually think of using fork or spawn threads, but when they find out that PHP doesn't support multithreading, they probably switch ideas to use some language that isn't good enough, like Perl.In fact,
The simplest example is the following
The code is as follows
Copy Code
pictures: foreach ($_files["Pictures"] ["error"] as $key => $error) {if ($error = = UPLOAD_ERR_OK) {$tmp _name = $_files["Pictures" ["Tmp_name"]
The code is as follows
Copy Code
Class code{ 1. Define members with wide, high, canvas, Word, type, painting type Private $width; WidthPrivate $height; HeightPrivate $num; Verification code number of wordsPrivate $imgType; Build
The code is as follows
Copy Code
//manual examples.
Select File and click Upload
The code is as follows
Copy Code
Print_r ($_files);?>
To view the source file:
code is
Include () produces a warning and require () causes a fatal error. In other words, if you want to stop processing the page when you encounter a missing file, use the
Require (). Include () is not the case, the script will continue to run. Also, be
1.Memcached Cache.Memcached is a high-performance distributed memory cache server, which reduces the number of database visits by caching database query results to improve the speed of dynamic Web applications. Memcached uses the "Key=>value" method
The code is as follows
Copy Code
Class Create_html { Private $template; Mould Plate Private $file _name; Filename Private $array; Array of data function __construct ($file _name, $template, $array) { Construct class
First of all we assume that there is such a level three classification, news →php News →php6.0 out.If we're looking for the news "PHP6.0 out", we'll click on the news and then click on the PHP news.
We can find out, which means we can look down
Ob_start (): The flag of page cache start, the content of this function until Ob_end_flush () or Ob_end_clean () is saved in the page cache;Ob_get_contents (): Used to get the contents of the page cache, to get to the future, we can think how to
code is as follows
copy code
? PhpClass Memcachemodel {Private $MC = null;/*** Constructs a method for adding servers and creating memcahced objects*/function __construct () {$params = Func_get_args ();$MC = new Memcache;If you
The code is as follows
Copy Code
To avoid errors caused by duplicate inclusion of files, add a condition that determines whether a function exists:$page = $_get[page];if (!function_exists (Pageft)) {Define function Pageft (), the
function Listfolders (){Set a path$dir = "./";
Set up an array of file pieces$aDir = Array ();
$oCurrentdir = Opendir ($dir); Open Directory
while ($sFile = Readdir ($oCurrentdir))//Read all subdirectories of the current directory{if ($sFile!= '.
jquery Ajax PHP to save the data and return the value
name: Area:--Unlimited-- Beijing --Unlimited-- Address:" " Download:
ajax.php
$v = $_post[' addboroughname '];if (not null) {if (saved successfully) {echo $borough _id. "| 1 ";}else{echo
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