PHP prevents Webshell processing functions

Import OS Import Sys Import re Import time def listdir (dirs,liston= ' 0 '): Flog = open (OS.GETCWD () + "/check_php Tutorial _shell.log", "A +") If not Os.path.isdir (dirs): Print "Directory%s is not exist"% (dirs) Return Lists =

PHP empties the HTML tag in the string

chr

function Clear_html_label ($html){$search = Array ("' ' si", "' ]*?> ' Si "," ' ([RN]) [s]+ ' "," ' & (quot| #34); ' I "," ' & (amp| #38); ' I "," ' & (lt| #60); ' I "," ' & (gt| #62); ' I "," ' & (nbsp| #160); ' I "," ' & (iexcl| #161); ' I "," ' &

PHP Crawl The Google hosts program code

Boring incredibly and find a PHP version of the crawl Google hosts files, try the next can also use, ping the next IP, the delay is not very high, the Web page opened test under the speed is also very fast, we are interested to try.PHP File: /***

How does PHP invoke the C # DLL class library? I'll tell you what.

Sometimes we need DLL libraries written in other languages in PHP, such as DLLs written in C #, by using the PHP new COM method to register the DLL library and put the assembly into the global cache before invoking it. 1. Create a C # Class Library,

PHP mb_substr Implementation of Chinese string interception without garbled method

Note: Find php.ini in Windows directory Open edit, search Mbstring.dll, findExtension=php_mbstring.dll the front of the number, so the MB_SUBSTR function can be effective Example The code is as follows Copy Code $str = '

PHP gets HTTP header Request status information

To use curl, you need to set up php.ini > Extension=php_curl.dll Removing the previous comment is both available. The implementation code is as follows: The code is as follows Copy Code $curl = Curl_init ();$url = '

PHP import phpmyadmin Generate SQL file practices

Share the methods I have used. Valid for PHP tutorial myadmin exported SQL files only $dbfile = "Test.sql";$content =iconv ("Utf-8", "gb2312", file_get_contents ($dbfile));Get the data createdRemove comments$content =preg_replace ("/--. *n/iu", "",

PHP Database backup Restore function

Backup Restore functions The code is as follows Copy Code function Write_file ($sql, $filename) {$re =true;if (!@ $fp =fopen ("./www.111cn.net/". $filename, "w+")) {$re =false; echo "failed to open target file";}if (!

PHP header () output picture cache

In many development, we try to use header ("Content-type:image/jpeg") to output pictures, try to use some PHP image processing technology, make the output picture more intelligent and dynamic. But we often encounter new problems, unless you specify

Collection of string functions in php

Truncates GB2312 Chinese strings. The code is as follows:Copy code // Truncate a Chinese stringFunction mysubstr ($ str, $ start, $ len ){$ Tmpstr = "";$ Strlen = $ start + $ len;For ($ I = 0; $ I If (ord (substr ($ str, $ I, 1)> 0xa0 ){$ Tmpstr.

Download php website program backup source code

This is a php Tutorial about website Directory Backup. The website backup program can package directories that you can operate on to generate rar compressed files. If you need this file, download it. Website Program backup Error_reporting (E_ALL &~

Simple php online editing and saving php file implementation code

If ($ _ get ['login'] = 'fuyun '){Header ("content-type: text/html; charset = gb2312 ");If (get_magic_quotes_gpc () foreach ($ _ post as $ k => $ v) $ _ post [$ k] = strips tutorial lashes ($ v );?>Save to: "> If (isset ($ _ post ['file']){$ Fp = @

A simple PHP image upload class with image display code

Uploadimg. class. Php file The code is as follows:Copy code Class upload{ Var $ upload_name;Var $ upload_tmp_address;Var $ upload_server_name;Var $ upload_filetype;Var $ file_type;Var $ file_server_address;Var $ image_w = 900; // The width of

Php ajax message board

*/ The code is as follows:Copy code $ Link = @ mysql_connect ($ db_host, $ db_user, $ db_pass) or die ('unable to establish a db connection ');Mysql_query ("set names 'utf8 '");Mysql_select_db ($ db_database, $ link );Class comment{Private $

Php image upload and preview

If (! Isset ($ _ session) session_start ();/** 2010-6-22* $ The data array type contains the following variables:-------------------------------* $ Sub_type submit type (upload: upload button delete: delete button), default upload* $ File the $ _

Php browser cache

Browser cache is totally different. The cached content is stored locally in the browser, but the content is generated by the web server. Neither party can complete this system process independently, therefore, there must be a communication mechanism

PHP scripts for uploading multiple files

Note: The original name of this article is Creating a Multi-File Upload Script in PHP. I think this article is generally written, and the code is not very professional, but it is short, and I can't find a better article at a time, so I translated it.

Php injection 3

III. Some injection techniques, many of which are personal discoveries1. Skills in union selectUNION is used to combine the results of multiple SELECT statements into one result set. Columns listed in the select_expression section of SELECT must be

Exercise caution when comparing the require_once () function to the Directory in php.

Assume that the following three files exist: localhost/demo The code is as follows:Copy code C. phpRequire_once ("a. php ");Require_once ("demo/B. php ");B: demo (); a. phpClass{} B. php's content is interesting, because it has to inherit CLASS

Various linefeed filtering methods in php

The code is as follows:Copy code // Line feed for different php systems// The implementation of line feed varies with systems.// In linux and unix/n// For MAC/r// Window is/r/n to reflect differences from linux// The Implementation methods on

Total Pages: 12780 1 .... 11743 11744 11745 11746 11747 .... 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.