PHP uses database information to generate static page instance code

The code is as follows Copy Code $con =mysql tutorial _connect ("localhost", "root", "") or Die ("Link error!!! ");mysql_select_db ("message", $con) or Die ("Database link error!!! ");mysql_query ("Set names ' GBK '");$sql

A regular expression that PHP determines whether the URL is legitimate

One '/^https tutorial//?. +. [A-z] {2,4}$/'; // '/^https//? +. [A-z] {2,4}/.*$/'; // '/^https?:/ /.+. [A-z] {2,4}/.*$/'; // '/^https?:/ /.+. [A-z] {2,4} (/.*|) $/i ' ///^http (s)?:/ /([a-za-z0-9.]? ([0-9a-za-z][0-9a-za-z-]+.) +[a-za-z]{2,5})

Simple instance PHP verification code code

Verification code is a public fully automated program that distinguishes users from computers and people. In the CAPTCHA test, the computer that serves as the server automatically generates a problem to be answered by the user. This problem can be

Remote page paging class for PHP

Page_total_rows-Per-page display number default value 20$total _rows-Total data entry number$totpages-Total Page Count$pages _current-Current pagePassing the current page number URL parameter name using the URL parameter pages$style-page number

Php+javascript Slide Generation Code

$bbsconn =mysql tutorial _connect ("localhost", "root", ""); mysql_select_db ("Lsmsql", $bbsconn); $kind = "slides"; $sql = "SELECT * from sa_article where kind= ' $kind ' ORDER by ArticleID desc limit 0,6"; $result =mysql_query ($sql); $pics =

PHP mimics user access to Web page program code

The code is as follows Copy Code function HttpGet ($url, $followredirects =true) {Global $final _url;$url _parsed = Parse_url ($url);if (Empty ($url _parsed[' scheme ')) {$url _parsed = Parse_url (' http://'. $url);}$final _url =

PHP ereg_replace function Base and instance code

String Ereg_replace (String $pattern, String $replacement, String $string)/*The modified string is returned. If no matching string is found, then the invariant is returned*/ Instance The code is as follows Copy Code

PHP Gets the relative path instance code

The code is as follows Copy Code function Getrelativepath ($a, $b) {$returnPath = Array (dirname ($b));$arrA = explode ('/', $a);$arrB = explode ('/', $returnPath [0]);     for ($n = 1, $len = count ($arrB); $n     &nb sp;   if

PHP Character Matching code

/*String A: "1,3,4,5,6,7,8,9,10,11,12,14,15,17,20,22,123,457",For example, I would like to know if this string contains "2", this Time "12", "20", "22" and so on*/One The code is as follows Copy Code if (In_array (' 2 ',

PHP File Upload Instance code

?if (! $UploadAction):?> The code is as follows Copy Code File Upload Interface " ?Else?> File Upload Code The code is as follows Copy Code ?$UploadAction = 0;echo

PHP upload a picture and make a transparent watermark to the picture

The code is as follows Copy Code $im = Imagecreatefromjpeg ($_file["Upload"] ["tmp_name"]); You want to draw water examples of pictures$watermark = Imagecreatefrompng ("Smiley.png"); Path to a watermark map$im _x = Imagesx ($im);$im _

Use PHP programs to protect your flash files

The protection in this article is to prevent the user from saving the swf file locally. In fact, this method has been used long ago. The main protection measure is to read the $ _ SERVER array in the php background. If the ActiveX control in IE is

PHP Shell compilation (Ultimate Edition)

I used to write a php cmd Shell without any technical content. I always felt that the function was weak and I didn't handle some problems well, such as browsing directories. After I went deep into PHP, I found a lot of interesting functions, so I

Common php regular expression functions

Common regular expression functions in php TutorialWe have a lot of regular expression codes, including Chinese regular expressions, digits, letters, regular characters, regular expressions, numbers, emails, and phone numbers, phone number regular

Php heap sorting implementation principle and application code

Author: lajabsEmail: agl0dhlvqgdtywlslmnvbq =This article uses php as the description language to explain in detail the heap sorting principleOptimization is not performed to ensure program readability.Some concepts about heap in php programs:Assume

Php static file generation class

Php Tutorial static file generation classDefined ('php tutorial X') or die (header ("http/1.1 403 not forbidden "));           Class include_createstatic{                            Private $ htmlpath = '';Private $ path = '';Public $ monthpath = '';

Php fgetcsv reads csv file code (1/2)

The code is as follows:Copy code Function get_csv_contents ($ file_target ){$ Handle = fopen ($ file_target, 'r ');While ($ data = fgetcsv ($ handle, 1000 ,",")){    $ Num = count ($ data );Echo " $ num fields in line $ row: ";$ Row ++;For ($ c =

Php product inventory management system development example tutorial (1/13)

Homepage file index.html Product inventory management system & Lt; td width = "100%" & gt; Product inventory management system Back to Home | registration | logon | Add a vendor | Add a product | purchase | Sales | View

Php online file and folder compression instance code

Note that this PHP Tutorial file compression code is used to help zip.exe files, so we need to extract zip.exe compressed files.If (! IsSet ($ _ GET ['dirname']){Show_input_form ();}Else{// Check if emptyIf (empty ($ _ GET ['dirname']) {Hg_exit

Php generates a drop-down list of years, quarters, and months from the specified time

The code is as follows:Copy code Function countSeason ($ start, $ end ){$ Temp = date ("Y-m", strtotime ("$ start + 3 month "));While ($ temp $ Time [] = $ temp;$ Temp = date ("Y-m", strtotime ("$ temp + 3 month "));    }Return $ time;}$ Time =

Total Pages: 12780 1 .... 9402 9403 9404 9405 9406 .... 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.