However, it is not easy to become a PHP programming expert. As many people think, as long as you can write a few simple
Code To solve a complicated problem, it is the PHP programming experts who need to consider more other problems. The following
$ DBH = @ mysql_connect ("localhost: 3306", "root", "9999 ");
/* Define the variable DBH. The mysql_connect () function means to connect to the MySQL database, and "@" means to block the error */
If (! $ DBH) {die ("error ");}
/* The die () function
$ Booksql = sprintf ("Update book set pass = % s where id = % d ",Getsqlvaluestring ($ _ post ['LIST'], "text "),Getsqlvaluestring ($ _ Get ['id'], "int "));
The getsqlvaluestring function can be changed to another function.
But use the sprintf ()
;;;;;;;;;;;;
; Syntax ;;
; The syntax of this file is very simple. Blank characters and rows starting with semicolons are ignored.Chapter titles (for example, [PHP]) are also ignored, even if they may make some sense in the future.
Set the
For example, after reading data from 2005-12-23, the page will be displayed :-.
ProgramProcessing brings a lot of inconvenience. Some information found that PHP. INI has the date processing function by default.
Solution:
Method 1: Define ini_set (
However, its UI is not convenient, not only PHP, but any webProgramming LanguageThere are similar issues in UI design. The host language and HTML are mixed in a file, and a large number of repeated htmlCode, Without any technical content, but it is
1. First download fckeditor2.6.5 from the official website. Http://ckeditor.com/download,#:the first is the latest version 3.0.1, and the second is FCKeditor 2.6.5.
2. Delete unnecessary items:
Delete fckconfig. JS, FCKeditor. JS, fckstyles.
Copy
Code Save it as CS. php. To save it as another name, modify the line .
Copy code The Code is as follows: Function zhuanhuan (){
$ Urlodd = explode ('/', $ _ Get ["url"], 2); // divide the link into two sections. // The first section is the
For example
Code 1:
Copy code The Code is as follows: // code 1
// Appearance layer class
Class lwordhomepage {
// Add a message
Public Function append ($ newlword ){
// Call the intermediate service layer
$ Serv = new lwordservicecore ();
$ Serv->
PHP supports two automatic loading methods.
The first scheme uses _ autoload, which is relatively simple and weak.
But there is a problem that cannot be solved, that is, to determine whether the file exists before include.
CopyCode The Code is as
Counterfeit referer instance code, mainly used for breaking through anti-leeching, slice, software, etc.
The complete program is provided here. You can modify the specific application on your own.The example I provided here is very simple. In fact,
The Chinese character string for the UTF-8 is three bytes
Copy codeThe Code is as follows: // Coding UTF-8
Echo strlen ('test text a test text ');
Echo '-';
Echo mb_strlen ('test text a test text', 'utf-8 ');
?>
Output: 25-9
The Chinese string of
(1) All data should be hidden inside the class.
(2) A class user must depend on the common interfaces of the class, but the class cannot depend on its users.
(3) Minimize messages in the protocol of the class.
(4) implement the most basic public
This was also the case when I went to the interview the day before yesterday, but I couldn't remember it. remember the date_sub (now (), 'interval 1 Day') in MYSQL; date ('y/m/d h: I: s ', mktime (date ('H'), date ('I'), date ('s'), date ('M'), date
Hide your. php file
Hide your. php file
I saw this method when I made a PHP online manual image today. Haha, I didn't notice it before. So I said that the manual is the best teacher.
Bytes ----------------------------------------------------------
This is an opinion feedback table created using PHP. It can be used for Online Mailing programs with slight modifications. It mainly allows visitors to fill out forms and send them to the Administrator's mailbox after processing them using PHP, send
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