Functions used to filter HTML code in php

/*----------------------Functions used to filter HTML code-----------------------*/Function htmlEncode ($ string ){$ String = trim ($ string );$ String = str_replace ("&", "&", $ string );$ String = str_replace ("'", "'", $ string );$ String =

How to solve the "unable to load mysql extension" problem that may be encountered during PHP installation

When accessing phpmyadmin, "mysql extension cannot be loaded. Check the PHP configuration ". Check that "php_mysql.dll" cannot be loaded.For php 4.x users, follow discuz! 4.0 the user manual description in the program can be done in general. The

Pagination in PHP

// Establish a database connection$ Link = mysql_connect ("localhost", "root", "wyh7ye ");; // Obtain the current page numberMysql_select_db ("test", $ link );If (isset ($ _ GET ['page'])... {$ Page = intval ($ _ GET ['page']);}Else ...{$ Page = 1;}/

Detailed description of php fsockopen forgery post and get Methods

Fsockopen spoofs the post and get methods. If you are looking for php processing code that spoofs the post and get methods, this is good.Copy codeThe Code is as follows:// Fsocket simulate post submission$ Purl = "http: // localhost/netphp/test2.php?

Php anti-injection, implementation of Form submission value escaping

During development, we should pay attention to preventing SQL injection. Therefore, we must process the values submitted in the form to update the data to the database.Php functions. Any value can be passed for conversion.Copy codeThe Code is as

PHP + Tidy-perfect XHTML correction + Filtering

Input and OutputInput and output are the basic functions of many websites. User input data, website output data for others to browse.Take the popular Blog as an example. The input and output here is the Blog article page generated by the author

Regular expressions that can filter multiple lines of code in dedecms collection

In the past, when I used dede for collection, I could not filter out more than one line of code, but only one row of Code. On the Internet, I found many cainiao like me. With the continuous use of dede collection, I have a better understanding of

PHP-based operations on XML

$ Xml = simplexml_load_file ('example. xml'); // create a SimpleXML objectVar_dump ($ xml); // output XML?> $ Xml = simplexml_load_file ('example. xml'); // read the xml fileForeach ($ xml-> depart as $ a) // read each depart tag in XML data

How to Use php to draw a positive cosine curve on an image

In the past, I used to write a trigonometric curve dynamically using actionscript. In fact, php also outputs a trigonometric curve very easily.Copy codeThe Code is as follows:Define ("MAX_WIDTH_PIXEL", 600 );Define ("MAX_HEIGHT_PIXEL", 240 ); //

Analysis on efficiency and stability of file_get_contents and curl

I have done a lot of products that crawl content from other websites and get used to using the convenient and fast file_get_contents function. However, I always encounter the problem of failed access, even though I set the timeout according to the

PHP CodeBase: display the time as & quot; n minutes/hour ago &

In many cases, in order to display the timeliness of information, the time is usually displayed as "just", "5 minutes ago", "3 hours ago", and so on, instead of printing the time directly. For Weibo, SNS applications use this function for the

Summary of seven methods for PHP to determine the image format

Use php to determine the file image formatCopy codeThe Code is as follows:$ Imgurl = "http://www.jb51.net/images/logo.gif ";// Method 1Echo $ ext = strrchr ($ imgurl ,'.');Echo ' ';// Method 2Echo $ ext1 = substr ($ imgurl, strrpos ($ imgurl

Usage of php serialize () and unserialize ()

Serialize () and unserialize () are described in the php manual as follows:Serialize-Generates a storable representation of a valueSerialize-generate a representation of a stored valueUnserialize-Creates a PHP value from a stored

Difference between fetchAll () and mysql_fetch_array ()

The same query statement:FetchAll ():Copy codeThe Code is as follows:Array (1 ){[0] => array (6 ){["Id"] => string (2) "15"[0] => string (2) "15"["Lot_sellid"] => string (20) "00000000000000003877"[1] => string (20) "00000000000000003877"["Lotteryid"

In-depth discussion & quot; & amp; lt; br/& amp; gt; & quot; and & q

\ R \ n is the line feed of the output HTML code, and the effect the customer sees is not a line break. the opposite is true.Effect:I am content \ r \ n I am contentI am content I am content==========================================================

A small example of php caching images generated by gd to memcache

Copy codeThe Code is as follows:// Start to cache ImagesOb_start (); // enable the output cache to temporarily cache the output contentImagejpeg ($ newimage, false, $ quality); // output$ Data = ob_get_contents (); // obtain the cache YOU JUST

From the perspective of experiences, php and mysql have solid basic skills.

I. 10 sentences1. do not rely ON the register_global = ON environment. From the day when you have just learned how to configure the php runtime environment and even do not understand the impact of register_global ON/off on yourself, we should be

Simple PHP Image Upload Program

First:Php SectionCopy codeThe Code is as follows:If ($ _ FILES ['file'] ['error']> 0 ){Echo '! Problem :';Switch ($ _ FILES ['file'] ['error']){Case 1: echo 'file size exceeds server limited ';Break;Case 2: echo 'the file is too large! ';Break;Case 3

Php simple paging program page 1/5

[Code] User Information summary ######################################## ################################ Connect to a database ######################################################## #####################$ Db = mysql_connect ("192.168.0.2", "root",

Mysql + php paging class (tested)

Copy codeThe Code is as follows:/*Mysql_pager.class.phpThree parameters. Mysql_query () result, url variable page, the number of records per page you wantThe example is at the bottom of the file.Danshui Riverside Sorting Test*/Class mysql_pager {//

Total Pages: 12780 1 .... 12327 12328 12329 12330 12331 .... 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.