Original address: http://127.0.0.1/onsite/index.php/welcome/index/abc123
Modified after address: http://127.0.0.1/onsite/abc123.html
Copy the Code code as follows:
Rewriteengine on
Rewritebase/onsite
Rewritecond%{request_uri}
Most people's image upload is to save a path to the database, so in the insert is really fast, but also in line with the characteristics of the web, but it is very troublesome to delete, need to find the file and delete, the code can be directly
The CodeIgniter framework is a very small PHP framework. The CI comes with the database file cache, but according to the official statement, the cache will never expire unless you invoke the method to delete it actively.
Cache files do not expire.
Generic paging Class (tested with CodeIgniter)
page_list.phpCopy the Code code as follows:
/*** Pagination Class*/Class Page_list {
/*** Total Data* @var int*/Private $total;/*** Show data per page* @var int*/Private $size;/*** Current Page* @
The following is the code for the session class
Copy CodeThe code is as follows:
Class session
{
static function init ()
{
Session_set_save_handler (
Array ("Session", "open"),
Array ("session", "Close"),
Array ("session", "read"),
Array ("Session"
Sometimes when you write some scripts on the server, you often have to put them in crontab and run them regularly. Long time, there is a problem, that is, the program repeatedly run consumes too much resources, how to deal with it? Here are two ways
When a server that handles network payments is migrated, it is found unable to pay.
PHP Environment:PHP version is 5.3.3System for Red Hat 4.1.2-54View Apache error log, found to be encrypted file in a function Bcmul () Error:Copy the Code code as
1. Run the following command in turn
Copy the Code code as follows: Wget http://pecl.php.net/get/zip-1.8.10.tgz
#tar ZXVF zip-1.8.3.tgz
#cd zip-1.8.3
#/opt/php/bin/phpize (corresponding phpize path)
PHP configuration file php.ini, search Extension=php_gd2.dll, remove the front semicolon can;
1. Add a verify method to the module class to display the verification codeCopy the Code code as follows:Public Function Verify () {Import the Image
1. Create/Update cookies
Copy CodeThe code is as follows:
Setcookie ($cookieName, $value, time () + number of seconds);
Example: Create a cookie with a name of username and a value of ZS with an expiration time of 2 weeksCopy the Code code as
Note: In this example, the build Web service uses SOAP to build the SOAP server through the PHP plugin nusoap.
Copy CodeThe code is as follows:
Require_once ("lib/nusoap.php"); Call Nusoap
$server = new Soap_server (); Creating a SOAP service
HTML code:
Copy the Code code as follows:
Simple Verification Code
JS Code:
Copy the Code code as follows:function Chkyzm (form) {//Verify the verification codeif (form.yzm.value== "") {Yzm1.innerhtml= "x verification code cannot be empty";}else
The principle of Memche Message Queuing is to make a fuss over the key to do a sequential number plus the prefix to record the message or log after serialization. The content is then dropped to a file or database via a timed program.
The use of PHP
These days have been using simple_html_dom to catch some articles. The coding of different websites is basically GBK gb2312 utf-8 in China. and to gb2312 and Utf-8 majority.
My version of the simple_html_dom has a way convert_text is this way.
Copy
The following is a unified script for deleting a table with the prefix "Prefix_":
Copy the Code code as follows:
Sets the database connection information. Database server address, database user name, data password
mysql_connect (' Database host '
Read a long time data structure but not how to use, in the Internet to see the data structure about PHP, learning a bit, and share with you.
Copy CodeThe code is as follows:Class Hero{public $no;//Rankingpublic $name;//NamePublic $next
1.library folder
If you want to extend the functionality of CI, then put your class library here, note that this folder is composed of class, you can see if loading library notes!
2.helper folder
If you need to use some function to help you do some
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