Although PHP is very advanced and complex, web development through PHP is time-consuming. Developers are more willing to spend more time on project details, so simplifying the complexities of PHP development is urgently needed by web developers. A small compilation of 8 PHP
PHP itself has some problems with the old version, such as some serious bugs before php4.3.10 and php5.0.3, so we recommend that you use the new version. In addition, the vigorous SQL Injection is also widely used in PHP, so to ensure security, PHP code writing is one aspect, and PHP configuration is even more critical
PHP itself has some problems with the old version, such as some serious bugs before php4.3.10 and php5.0.3, so we recommend that you use the new version. In addition, the vigorous SQL injection is also widely used in PHP, so ensure that
Security, PHP code writing is one aspect, and PHP configuration is critical.
We man
PHP page UTF-8 encoding problem1. Add a line to the beginning of the code:
The code is as follows
Copy Code
Header ("Content-type:text/html;charset=utf-8");
2.PHP file Encoding Problem
Click on the Editor's menu: "File"-> "Save As", you can see the current file encoding to ensure
Php Tutorial System Time Zone 8 time difference Setting MethodYou can modify the time zone of the php System in either of the following ways:1. Modify php. in the INI file, locate "; date." in [date. timezone = ", change this item to date. timezone = asia/hong_kong (prc China time), and then restart the apache server.
Php Tutorial system Time Zone 8 time difference setting methodYou can modify the time zone of the php System in either of the following ways:1. Modify php. in the INI file, locate "; date." in [date. timezone = ", change this item to date. timezone = asia/hong_kong (prc China time), and then restart the
New on Ali server ECS and cloud database RDS (US Silicon Valley node), starting from zero security settings, environment installation, record
First, open the Cloud shield.
The CentOS6.5 system is selected and there is a data disk. 1. Mount the data disk
Reference Linux system Mount data disk
View a data disk
Df–h
Fdisk-l
Partitioning a data disk
Fdisk-s 56/dev/xvdb
View the new partition
Fdisk-l
Format a new partition
Mkfs.ext3/dev/xvdb1
Add p
Problem one: When we do the database operation, we will find that the table in the database is encoded with UTF-8, but the DOS command is to use set names GBK(a) The default character set in MySQL is four levels: server level, database level, table level, and field level top three are the default settings, does not mean that your field will eventually use this character set(ii) Set names this MySQL command
PHP beginners (8) 7. file Upload
You can use PHP to upload files. Note that the browser on the client should be Netscape3 or later or IE3. At the same time, because this program is related to your PHP configuration file (PHP3 is php3.ini and PHP4 is php. in)
prohibition is not necessary, but we consider it to be safe. For example, we do not want to execute PHP functions that include the system () and the ability to execute commands, or to view PHP informationPhpinfo () and so on, then we can disable them: Disable_functions = System,passthru,exec,shell_exec,popen,phpinfo If you want to prohibit any file and directory operations, Then you can close many file o
workaround for 8 hours of date time in PHP
On Windows , in the default PHP configuration, the time value returned by the DATE function is always 8 hours from the local time, that is, the GMT is displayed. The solution is to set the PHP time zone environment correct
/timingcall.phpperform a total of 60 times from 11 o'clock to 12 in the evening.* * * * * /usr/bin/php-f/var/www/222.com/www/ipphone/timingcall.phpexecuted 1 times in the evening 11:01(Note:-F is important and cannot be modified to-Q) 4. How to verify that the crontab file existsif CRONTAB-E is unsuccessful, modify the command in the/var/spool/cron/crontabs user fileTo verify that the user's crontab file exists, use the Ls-l command in the/var/spool/c
In the long talk, I am confused about many people's problems. If they are not well handled, they are all garbled characters. I am not very proficient in coding, but I have to be careful in this regard, I have summarized a little experience (PHP files are prone to garbled characters, encoding stored in the database, page display, and data transmission ):
1. During database creation, especially when phpMyAdmin is used to deal with MYSQL, it is generally
Set the current output time in the local time zone of php: lt ;? Php $ timedate (Y-m-dH: I: s); echo $ time; hour? How is it 2009-02-2606: 52: 58. The time of the local machine (Shanghai) is clearly: 2009-02-2614: 52: 58. I entered the next 8 hours in advance. :) You have already guessed that the UTC + 8 zone is a tim
In the long talk, I am confused about many people's problems. If they are not well handled, they are all garbled characters. I am not very proficient in coding, but I have to be careful in this regard, I have summarized a little experience (PHP files are prone to garbled characters, encoding stored in the database, page display, and data transmission ):
1. During database creation, especially when phpMyAdmin is used to deal with MYSQL, it is generally
contains a text link, which is like xxxx. when you click submit, you will see that in the address bar of ie, you can see the "man", which is output after you receive it on the page. it turns into "bang". The problem arises. after submitting the UTF-8 page, the output page is also UTF-8 encoded, but it is an error. Note that this is not a problem with your environment s
You can set the server-to-error alarm level in php.ini. By default, PHP will report all errors except for notifications.Error reporting levels are set by a number of predefined constants,Grammarint error_reporting ([int level]) 1 e_error report fatal error at runtime 2 e_warning report non-fatal error running 4 E_PA RSE Report parsing error 8 E_notice report Notice, notice that the thing that is being done
In addition, the current busy SQL injection is also in PHP have a lot of ways to use, so to ensure security, PHP code writing is on the one hand, PHP configuration is very critical.
Our PHP hand-installed, PHP default profile in/usr/local/apache2/conf/php.ini, our main is to
will be in the session. when auto_start = On, destroy the automatically generated Session, set the needed serialization processor, and then call the session_start () function to register the Session. If the serialization processor set in the script and php. different settings in ini will cause security issues, as shown in the following code:
//foo.phpif (ini_get('session.auto_start')) { session_destroy(
The old voice talks, is confused many people's question, if the processing is not good, are garbled, said these words is not my code is very proficient, just in this respect is to be careful, I summed up a little experience (easy to appear garbled place has PHP file inside, the database stored in the code, page display, data transmission):
1. In the construction of the database, especially with phpMyAdmin and MySQL when dealing with, is generally utf
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.