PHPsetcookie () solution to cannotmodifyheaderinformation error Cookie
When using the setcookie () function, the following error is always reported:
Warning: Cannot modify header information-headers already sent ....
The solution is as
The php Forum collection program simulates login and captures the page implementation code. For more information, see.
The code is as follows:
// Wu Yanjun
// 2009-06-27
// Collection program php
Set_time_limit (0 );
// Cookie storage directory
$
Sometimes we need to control the expiration time of webpages such as home pages. For example, if we use Chinacache CDN, how should we design it so that it can cache my content. of course, you must first enable the reload_assist_ims on function in
How to process multiple submit submission forms in php (differentiate different forms) test. php
The code is as follows:
$ Test = $ _ POST ['test'];
Echo '12 ';
Echo $ test;
Echo $ _ POST ['submit1'];
Echo $ _ POST ['submit2'];
If (isset ($ _
In fact, this leads to the problem of server output control and browser cache, which is a bit complicated and will be studied again later. IE6
When uploading and generating a thumbnail, the link displayed by the thumbnail is as follows;
The code
Phpsplit Chinese character implementation code.
Method 1:
To load the Encode module, you must install this module.
Sample code:
The code is as follows:
$ Str = decode ("gb2312", $ names [$ index]);
@ Chars = split (//, $ str );
Foreach (@
I don't know how PHP beginners learn functions, but I think learning functions must be objective-driven. taking array functions as an example! How can we learn so many array functions? In fact, we only need to know what operations we need to perform
PHP does not need (or does not support) explicit type definitions in variable definitions. variable types are determined by the context in which the variable is used. That is to say, if a string value is assigned to the variable var, var becomes a
I wrote several ID card functions, and I personally felt very useful. especially in the online questionnaire survey, it is very useful to verify the ID card in my personal information, but there are few applicants, you can leave it in your own blog.
I believe many people use zendstudioforeclipse to write code, but sometimes there is no syntax prompt for a good project, and it is very depressing. In fact, this is because the project has not been compiled by zend studio for eclipse (it should be
When multiple developers write object-oriented applications, a PHP source file is created for each class definition. A big headache is that you have to write a long list of contained files at the beginning of each script (each class has one file.
When you use php to upload files or perform operations on files such as moving files, the file naming problem is generally handled. if you use the original file name, you may encounter a situation where the file name already exists, some methods are
The discuz6.1 php interface officially provided by the locomotive is relatively rough and basically cannot meet the needs. The collection interface file I used in the collection work is as follows: PS: the original file is greatly modified, the
Difference between $ _ SERVER [PHP_SELF] and $ _ SERVER [SCRIPT_NAME] in php: "PHP_SELF"
The file name of the script being executed, which is related to document root. For example, using $ _ SERVER ['php _ SELF '] in a script with a URL address of
Many people are also using PHPSimpleDom on the internet. although the efficiency is a little slow, the effect is still good, from including the class library file to the txt file written in about 78 seconds.
The code is as follows:
// Contains the
In the actual development process, you will often encounter some repeated operations. if you need to implement it on your own every time, this will undoubtedly increase your workload and sort out some classes that may be frequently used.
Chart
All PHP file packages remove all comments in one PHP file remove extra spaces keep output pure PHP (that is, no additional processing steps are required to parse the file) usage: (run on the command line)
The code is as follows:
Php compactor. php
PHP is actually a thief program to get the implementation code of network files. For php thieves, refer.
The code is as follows:
// Set the file to be used
$ Srcurl = "http: // localhost/index. php ";
$ Tempfilename = "tempindex.html ";
$
Friends who have used SESSION in PHP may encounter such a problem. SESSION variables cannot be transferred across pages. This has plagued me for a few days and finally solved this problem by checking the information. I think the reasons for this
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