first, the controller must be added to the verification code method admin/lib/action/loginaction.class.php
Knowledge Points:
1. Ob_clean function Use
2. Import method call think default class library
3. Image class Buildimageverify method use
The
For PHP to traverse the directory and file list to write a simple class, and attach the use of examples, we refer to the use of it
Copy the Code code as follows:
Define (' DS ', directory_separator);
Class getdirfile{
Returns an arrayPrivate
Copy CodeThe code is as follows:
/*** Encryption and decryption classes* This algorithm only supports encrypted numbers. Compare the encryption decryption that applies to the ID field in the database, and the encryption based on the digital
Method of invoking the tracker
Copy CodeThe code is as follows:
$Profiler = $Db-Getprofiler ();
Copy the Code code as follows:
/*How to use the tracker*/
Introducing the loader class (auto-load Class)Require_once
Pagination page numbering display algorithm
Copy CodeThe code is as follows:/*** Get HTML content for pagination* @param integer $page current page* Total number of pages $pages @param integer* @param string $url The last page of the URL address
This example CodeIgniter registered login code from a CodeIgniter project and now shares the following ~
Because the Active Record class is used, the general database operation is only two layers, that is, C and V
controllers/login.php file:
Copy
The thinkphp
F method can only be used to cache simple data types and does not support expiration and cache objects . The S () cache method supports the validity period, also known as the dynamic caching method, using the following example:
Copy
If you get a second $str[1] or $str{1}, it is not recommended to use {}, it is best to use []
Test as follows
Copy the Code code as follows:
Gets the last character of a character
$str = ' phpddt.com ';
echo $str [Strlen ($STR)-1]; M
Modify the
Copy the Code code as follows:
PHP line breaks for different systems
The implementation of line breaks between different systems is not the same
Linux and Unix use \ n
MAC with \ r
window to be different from Linux is \ r \ n
So the implementation
Find the relative path of two directories without limiting the path depth
Copy the Code code as follows:
/**
* Output $b relative path relative to $ A ($a)
* Unlimited path depth, no optimizations, just implementation functions
*/
function GetPath
Copy CodeThe code is as follows:
$str = "Hello
Love Beijing {Tiananmen Square} ";
Echo F1 ($STR); Back to Helloecho F2 ($STR); Return to myecho f3 ($STR); Return to Loveecho f4 ($STR); Back to Beijingecho f5 ($STR); Back to Tiananmen
Function
The process of page output in previous versions of thinkphp is to read the template file and then parse it (also support invoking third-party template engine parsing), but in some cases we do not define the template file, or save the template file
The M method is used to instantiate a base model class,
the difference between the and D methodsIs:
1, do not need to customize the model class, reduce IO loading, good performance;2, after instantiation can only invoke the Basic model class (the
First, we now look at a simple example:
Copy the Code code as follows:
$a = 2;
($a = = 1)? $test = "Enterprise": $test = "region"; #写法一
Echo $test;
?>
The above example, first determine whether a $ A is 1 if the "enterprise" this string into the
1. Detect if Apache supports Mod_rewrite
Using PHP's Phpinfo () function to view the environment configuration, through Ctrl+f find to "Loaded Modules", which lists all the Apache2handler has been opened module, if it includes "mod_rewrite", it is
First, the Phpmailer version used primarily by Ecmall is too low and does not support encrypted connections.
Then, you have to make some adjustments to the corresponding code.
1. Cover Phpmailer
Please download from the attachment:Copy the Code
CodeIgniter data function classes in \system\database\db_active_rec.php
Copy the Code code as follows:Class ModelName extends Ci_model{function __construct (){Parent::__construct ();}}
Connection database: $this->load->database ();
Copy the Code
CodeIgniter is an application framework
1, Free: CodeIgniter is authorized by Apache/bsd-style Open Source license, you can use it as long as you wish.
2, simple: CodeIgniter is really lightweight, the core system only need some very small library.
3
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