Web development is not an easy task, with the Super Multi-server scripting language available to developers, but the current PHP is becoming more and more popular because of some additional powerful features. PHP is one of the most powerful
Occasionally see a paragraph, it seems that there is no problem, it is a fatal backdoor code, here used a general phper not pay attention to the reverse apostrophe ', the reverse apostrophe contains strings, equivalent to the Shell_exec function.
The eval function of PHP is not a system component function, so we cannot prohibit it by using disable_functions in php.ini.
But Eval () is very lethal to PHP security, so generally do not use the case in order to prevent similar to the following a
In the use of PHP to do things when found a problem, can be simply summed up as a garbled problem, but the problem is not the function itself. To see who the culprit is.
Suspect: Base64_encode and Base64_decode
Crime: I wrote a jump and prompt
If you use the Base64_encode and Base64_decode methods directly, the generated string may not apply to the URL address. The following method resolves the problem:
URL-safe string encoding:
Copy Code code as follows:
function
In the PHP program needs to use the C code, should be the following two kinds of cases:
1 already have C code, in PHP program want to use directly2 due to PHP performance problems, need to use C to achieve some of the functions
In the first case,
Recently hand a small project let me contact with PHP programming, simple landing function has been OK. But in actual use when found a problem: User A To send a link to the user B,b open page prompts landing, but after the successful landing, but
Beginner PHP to do the website, want to get the current time on the page, the person who has studied programming knows to use the time function date (), first uses this function to format a local time/date, first writes a test code, the result
When doing development, the operation session sometimes encounters this problem: Warning:session_start () [Function.session-start] ...
System Environment: win2003+iis6+php5.2.12
PHP appears similar to the following error:Warning:session_start ()
PHP is a server-side scripting language used to develop dynamic Web applications. No good server-side debugging tool is one of the limitations compared to Java. We usually add echo, var_dump, and so on in the PHP code to display the variable, the
The following PHP code resolves the following issues:
1.json_encode UTF8 code in Chinese after the string is not readable
The problem of Chinese garbled 2.json_encode in multi-series group
The 3.json_encode array contains a newline error
Actually in the course of the project, we often encounter the path to get the previous page address. You can go back to the previous page using
Copy Code code as follows:
This is done through JS.
If there is such a scenario,
About Spl_autoload_register () and __autoload (), I believe most will choose the former? See the use of both:
Copy Code code as follows:
__autoload usage
function __autoload ($classname)
{
$filename = "./class/". $classname. ".
Until recently, to do a web thief program to find that File_get_content has been completely unable to meet the demand. I think, in reading remote content, file_get_content in addition to use than curl convenient, other than curl good.
Main
Copy Code code as follows:
Class helper_spell{
Public $spellArray = Array ();
static public Function GetArray () {
Return Unserialize (file_get_contents (' pytable_without_tune.txt '));
}
/**
* @desc Get the first letter of the string
*
How to keep the session in PHP and some of the thoughts arising from it the recent project, which has a relatively large form, the user to complete it takes a lot of time, many users spent painstakingly completed, a submission found session expired,
This question is also only recently thought of, is to read the file faster or read the database faster, can quickly how much, the days are also searched, did not see a netizen to answer this question, it may be too simple sake, we have to test 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