PHP obtains the Proxy Server IP address used by the user, that is, the real IP address.

From http://www.phpchina.com/bbs/thread-12239-1-1.html Use $ _ server ["remote_addr"] in PHP to obtain the Client IP Address However, if the client uses a proxy server to access The IP address of the proxy server is obtained. To obtain the

A piece of anti-theft PHP code

$ Admin [defaurl url] = http://www.163.com/404.htm; // address returned by leeching $ Okaysites = array ("http://www.163.com/", "http://163.com"); // White List $ Admin [url_1] = http://www.163.com/download/; // download location 1 $ Admin [url_2]

PHP file read/write method (generate HTML)

// Generate html $ Countfile = "template.html "; $ Num = file_get_contents ($ countfile ); Echo $ num; $ Num = str_replace ("| * | page_title | * |", "myhome", $ num ); $ Path = "template.html "; $ Handle = fopen ($ path, "W"); // The Path to

Php predefined Constants

These constants are defined in the PHP kernel. It includes PHP, Zend engine, and SAPI module. PHP_VERSION (string) PHP_ OS (string) PHP_EOL (string)Available from PHP 4.3.10 and PHP 5.0.2 PHP_INT_MAX (integer)Available from PHP 4.4.0 and PHP

Regular Expression for learning instances in php

View instance learn Regular Expressions First, let's take a look at two special characters: '^' and '$'. They are used to match the start and end of the string respectively. The following are examples: First, let's take a look at two special

Analyze the output buffer in PHP

Let's take a look at the Code: For ($ I = 10; $ I> 0; $ I --){Echo $ I;Flush ();Sleep (1 );}? > 〉 According to the php manual, this function sends all the output of the program so far to the user's browser. The above code should output $ I every

Php advanced: unlimited classification page 1/4

1. Analysis When we use php to create a website, classification is very important. The second classification is called subclassification under the classification. Currently, most websites are classified only into the third category: First category (

Basic php knowledge: class and object (1)

Class Definition:It starts with a keyword class and follows the class name. It can be any non-PHPThe name of the reserved word. Followed by a pair of curly braces, the bread contains class member and method definitions.Pseudo Variable $ thisWhen a

How to attack common vulnerabilities in PHP programs (I) page 1/2

The reason for translating this article is that the current articles on CGI security take Perl as an example, while there are few articles specifically about ASP, PHP or JSP security. The Shaun Clowes article comprehensively introduces PHP security

How to Write a php program?

If you only use Frontpage and Dreamweaver's WYSIWYG editing mode to write a webpage, but do not understand the HTML syntax at all, I am afraid you need to understand the HTML syntax first, to write the PHP program smoothly. If you have a long

Calculate the size of your PHP Program

Copy codeThe Code is as follows: /*** Calculate the program specification under the project, including the number of cases, rows, and words.** @ Version 1.0* @ Since 1.0* @ Access public* @ Author ry* @ Copyright Copyright (c) 2002-2004 by Shiner

File Upload in PHP

In PHP, file upload is generally implemented through move_uploaded_file. Bool move_uploaded_file (string filename, string destination) This function checks and ensures that the file specified by filename is a valid Upload File (that is, the File

Some interesting little differences in PHP

The difference between single quotation marks and double quotation marks: The first is that single quotation marks are more efficient than double quotation marks, because double quotation marks are used to pre-process the content. For example, the '

Some common php Functions

1. generate random string functions Function random ($ length ){$ Hash = '';$ Chars = 'abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxy ';$ Max = strlen ($ chars)-1;Mt_srand (double) microtime () * 1000000 );For ($ I = 0; $ I $ Hash. =

Object-Oriented Programming in PHP: a solution to large-scale PHP Engineering

This article introduces Object-Oriented Programming (OOP) in PHP ). I will demonstrate how to use object-oriented concepts to compile less code but better programs. Good luck. The concept of object-oriented programming has different views for each

Make PHP user-defined function return multiple values

PHP user-defined functions can only return a value using the return statement. After the return statement is executed, the entire function is terminated. Sometimes, when a function is required to return multiple values, return cannot be used to

Principle of dynamic and static PHP changes

I know the method of outputting static pages using PHP. One is to use the template technology, and the other is to use the ob series functions. Both methods look similar, but they are actually different. First: Use templates. At present, PHP

Thief PHP + Html + Cache

If you read the target site once every 20 hours, you can modify it by yourself. You can see how to get it from other sites. It's very easy. Chuanqi. php // thief Copy codeThe Code is as follows: Extract ($ _ GET); extract ($ _ POST ); $ Clinchurl = "

Common PHP code

Add ob_start () to the header file when you cannot switch// Write global variablesSession_start (); // after data cannot be submitted, add: extract ($ _ POST); extract ($ _ GET); extract ($ _ SESSION ); Session_register ('pt _ usr_nm '); // write

Php and ajax experience

Ajax is an asynchronous callback method! It also works with transmission methods on the server side, such as GET or POST. What I am talking about here is that when xml or json data is transmitted, PHP differs from other server languages in that

Total Pages: 12780 1 .... 10314 10315 10316 10317 10318 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.