First turn on web sharing.
Configuration
httpd.conf Add PHP extension/etc/apache2/httpd.conf
If ulimit_max_files= "ulimit-s-n ' ulimit-h-n '" error appears
Need to remove
/usr/sbin/apachectl inside Ulimit-s-n ' ulimit-h-n
Restart Apache
Brew
1. Write the Curl class to crawl Web content
Copy CodeThe code is as follows:
Class Curlutil
{
Private $curl;
Private $timeout = 10;
/**
* Initialize Curl Object
*/
Public Function __construct ()
{
$this->curl = Curl_init ();
curl_setopt
Copy CodeThe code is as follows:
/**
* Decoration mode
*
* Dynamically add some additional responsibilities to an object, which is more flexible than generating subclasses in terms of extension functionality
*/
Header
Copy CodeThe code is as follows:
/*
* Login
*/
Public Function Login () {
if ($_post[' submit ']) {
$DB = D (' Login ');//Custom model processing
If inside is the thinkphp automatic verification.
if (! $DB->create ()) {
$this->redirect ('
Copy CodeThe code is as follows:
Open File
$fp =fopen (' tmp.html ', ' R ');
Reading the contents of a file can be done with the following two functions Fread,file_get_contents
$str =fread ($fp, FileSize (' tmp.html ')); FileSize to get file
First, upload the form HTML code
Copy CodeThe code is as follows:
Note: 1, action is the upload of new
2, Enctype this attribute to write "Multipart/form-data"
Second, PHP code
Copy CodeThe code is as follows:
if (Is_uploaded_file
Copy CodeThe code is as follows:
/**
* Bridging mode
*
* Separate the abstract part from its implementation and use them to change independently
*/
Abstract class Implementor
{
Abstract public function operation ();
}
Class Concreteimplementora
first, the database operation
1. Connect MySQL Data
Mysql_connect ()
e.g.
Copy CodeThe code is as follows:
$db = mysql_connect (Mysql_host, Mysql_user, Mysql_password) or Die (' unable-connect, please check connection paremeters ' );
2. Select a
Copy CodeThe code is as follows:
/**
* Broker Mode
*
* Use a Mediation object to encapsulate a series of object interactions so that the objects do not need to explicitly reference each other so that they are loosely coupled and can independently
Copy CodeThe code is as follows:
function Array_add ($a, $b) {
Gets the intersection of two arrays based on the key name
$arr =array_intersect_key ($a, $b);
Iterates through the second array if the key name does not exist with the first array,
Copy CodeThe code is as follows:
/**
* Prototype mode
*
* Use the prototype instance to specify the kind of object to create. and create new objects by copying this prototype
*
*/
Abstract class Prototype
{
Private $_id = null;
Public function
First, verify that the server hardware is sufficient to support the current traffic.
Ordinary P4 servers generally support up to 100,000 independent IPs per day, if the traffic is larger than this,
Then you must first configure a higher-performance
At this point, the function bool Session_set_save_handler (callback open, callback close, callback read, callback write, callback destroy, CALLB ACK GC) is the solution that gives us the solution to this problem.
The 6 functions used by the function
Copy CodeThe code is as follows:
#!/usr/local/bin/php-q
Author:freemouse
Here is the description.
Print ("This program is used to merge 2 640x480-sized. \ n");
Print ("Picture, and convert it to a picture of 400x300 size \ n");
Print ("required to
Session_unset ()
Frees all $_session variables that are currently created in memory, but does not delete the session file and does not release the corresponding session
Id
Session_destroy ()
Delete the current user's session file and release
Returns an array of common elements for the intersection (only the array is worth comparing), the ARRAY_INTERSECT_ASSOC () function is binding the key and value, and the Array_intersect_key () function compares the key values of two arrays. Returns
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