Random ad display (PHP function)

######## Random ad display ##########Function myads (){$ Dir = "ads"; # Set the directory for storing records// $ Dir = "ads"; # Set the directory for storing records$ Ads = "$ dir/ads.txt"; # Set the ad code file$ Log = "$ dir/ads. log"; # Set the

Tips for sending emails after registration

// Mail. php// Read the email content$ Filename = "wellcom.txt ";$ Fd = fopen ($ filename, "r ");$ Contents = fread ($ fd, filesize ($ filename ));Fclose ($ fd );// Replace the corresponding content$ Contents = eregi_replace ("", $ UserName, $

Share one page of news publishing with multiple data tables

In order to be simple and describe the main content, some secondary html content is relatively simple.When the website has multiple content to be displayed on a page, you can use one display and submit on the page.In this example, there are two data

Dynamic generation of stacked menus

"METHOD = POST>If (isset ($ hierarchy )){// $ Hierarchy [] = $ selection;If (isset ($ hierarchy )){While (list ($ level, $ sel) = each ($ hierarchy )){Echo " ";Echo $ level, ':', $ sel, " n ";$ Nextlevel = (int) $ level + 1;}}}Else {$ Nextlevel = 0;}

Chinese display in image Functions

Convert the GB code to UTF8. in php, TTF supports UTF8 encoded non-ASCII characters. after analyzing this code, we found that the image can be output in combination with Chinese characters and ASCII characters, which makes it easier for us to

Use PHP to send emails

A script that sends a E-MAIL may be one of the most common scripts you can find on the Web site, although it is very simple, a mail script can sometimes make programmers very frustrated. in PHP, there is a function called mail (). It only needs to

PHP and MySQL basic tutorial (2)

Data VerificationClear SpacesThe trim function will clear spaces at the beginning and end of the Data. Its syntax is:Trim ($ first_name );Processing of required fieldsSome fields must be entered in your database. In this way, the fields

Use of GET variables in PHP

After PHP4.1.0, HTTP_GET_VARS is saved using the GET variable. The GET variable mainly comes from the following methods:For example, the URL that requests the server to obtain information, use the form method as the get method. In this way, all

The sixth day of ten days to learn php

Objective: to add, delete, and modify data Mysql_query ($ exec );This statement can execute all the operations. The difference is that the SQL statement $ exec Add: $ exec = "insert into tablename (item1, item2) values ('". $ _ POST ['item1']. "',"

The fifth day of learning php in ten days

Objective: to learn to read data Let's first look at two functions:1. mysql_queryReturns a query string. Syntax: int mysql_query (string query, int [link_identifier]); Return Value: integer This function sends a query string for MySQL to perform

Content-type description

Content-type description $ Mimetypes = array ('Ez '=> 'application/andrew-inset ','Hqx' => 'application/mac-binhex40 ','Cpt' => 'application/mac-compactpro ','Doc' => 'application/msword ','Bin' => 'application/octet-stream ','Dms '=>

30 PHP best practices for beginners (no lights in the wilderness)

1. Become a good friend with the PHP Manual2. Enable Error Reporting.Error reporting is very helpful in PHP development. You can find errors you have not found in your code, because not all bugs will make the program run impossible. When the product

PHP Verification Code

The checkcode. php generates the verification code image and the variable $ _ SESSION [check_pic].Copy codeThe Code is as follows:Session_start ();For ($ I = 0; $ I $ Rand. = dechex (rand (1, 15 ));}$ _ SESSION [check_pic] = $ rand;// Echo $ _

Implementation Code for batch replacement of file names in php

The Code is as follows:Copy codeThe Code is as follows:$ Dir = 'd: \ Program Files \ resource \ application \ Skin \ PNG \ '; // note the path here. Add two \ s to the end. The first one indicates the conversion, however, in this case, it is easy to

Description of Chinese variables in PHP

A valid variable name in PHP starts with a letter or underline, followed by any number of letters, numbers, or underscores. According to the normal regular expression, it will be expressed as: '[a-zA-Z _ \ x7f-\ xff] [a-zA-Z0-9 _ \ x7f-\ xff]

Php design mode DAO (Data Access Object Mode)

Copy codeThe Code is as follows:/*** Data Access Object example** @ Create_date: 2010-01-04*/Class BaseDAO{Var $ _ db = null;Var $ _ table = null;Function BaseDAO ($ config){$ This-> _ db = new MysqlDB (); // operation not allowed here}/*** Get and

Php idea and implementation of creating automatic file numbers

Requirement: automatic numbering can be implemented for new files in the system. For example, the default file name for creating a new text file is: Create a text file .txt. If the file name changes automatically when the new file is continued:

The type of the codeigniter xmlrpc class in php during data exchange

The request sent by the client is similar to thisCopy codeThe Code is as follows:$ Request = array ('parameters00', 'parameters01 '); In client requests, you can specify the parameter data type. You can separate each parameter into an array and

Php thumbnail implementation function code

Array getimagesize (string $ filename [, array & $ imageinfo]) to get the image sizeResource imagecreatetruecolor (int $ x_size, int $ y_size) creates a true color image.Resource imagecreatefromjpeg (string $ filename) creates an image from a JPEG

Concepts related to operators learned in php

Copy codeThe Code is as follows:/* Operator number (PHP) operator symbol** By operator number:* 1. Arithmetic Operators +-*/% + + --* 2. String operators. Concatenation Operators* 3. Value assignment operator = + =-= * =/= % =. =* 4. Comparison

Total Pages: 12780 1 .... 9224 9225 9226 9227 9228 .... 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.