PHP form submission secure usage page 1/2

It is used to display error information and success information. In fact, you can also directly echo the error information. Here I just want to see the highlights of my error information page and define a function for page output. CopyCode The Code

PHP implements a function for converting Arabic numerals to Chinese numerals

If you want to convert the amount, modify the processing of the decimal part. Function ch_num ($ num, $ mode = true ){$ Char = array ("zero", "one", "two", "three", "Si", "Wu", "Lu", "Jun ", "success", "fail ");$ DW = array ("", "Pick", "audio", "

A few good examples of PHP getting started

1. php connects to the database $ Dbhost = 'localhost ';$ Dbuser = 'root'; // your MySQL user name$ Dbpass = '000000'; // your MySQL password$ Dbname = 'data'; // your MySQL Database Name // Connect to the local database$ Globals ["conn"] =

Generate random usernames in batches using PHP

Program 1. It is responsible for randomly extracting data from the dictionary and writing a new file. (1.php) CopyCode The Code is as follows: /* Extract random values from dictionary files */ $ File1 = "./words. DIC ";$ File2 =

Application of PHP binary in IP address query

The database stores hundreds of thousands of IP records. The record set is as follows: + ---------- + ------------ + --------- + -------- +| Ip_begin | ip_end | country_id | prov_id | city_id | isp_id | netbar |+ ---------- + ------------ + ------

Post details submitted in PHP socket mode

/* ** Post messages to the host */ Function posttohost ($ URL, $ data ){ $ Url = parse_url ($ URL ); If (! $ URL) Return "couldn \'t parse URL "; If (! Isset ($ URL [\ 'port \ ']) {$ URL [\ 'port \'] = "";} If (! Isset ($ URL [\ 'query \ ']) {$ URL [

10 things you may not know about in PHP

On the other hand, sometimes you can use a simple line Code To solve a problem. The following are some cool features that you may not have noticed: Use the ip2long () and long2ip () functions to convert an IP address into an integer and store it

PHP examples of extracting gzip files or strings

In fact, it is very easy for PHP to decompress gzip. You can use the built-in gzdecode function, but it is a pity that I have been configured for half a day and cannot support the gzdecode function, so I have to work around it: CopyCode The Code is

Tips for common PHP Functions

1. returns the file extension.Function getformat ($ file){$ Ext = strrchr ($ file ,".");$ Format = strtolower ($ ext );Return $ format;} 2. format the variable$ Num = 1;Printf ("% 04d", $ num );?> 3. php redirection webpage// For example,

Detailed parameters and descriptions of $ _ server in PHP

$ _ Server ['php _ Self '] # File Name of the script being executed, which is related to document root.$ _ Server ['argv'] # parameters passed to the script.$ _ Server ['argc '] # include and pass Program Number of command line parameters (if

Conversion of some common Regular Expression characters in PHP

Match double-byte characters (including Chinese characters): [^ \ x00-\ xFF] Application: Calculate the length of a string (two-byte length Meter 2, ASCII character meter 1) String. Prototype. Len = function () {return this. Replace ([^ \ x00-\

Comparison of Two time subtraction sorting for PHP array applications

$ KKK = custom_tuijian ("2008-08-15", date ("Y-m-d ")); // Echo date ("Y-m-d "); // Print_r ($ kkk ); Function custom_tuijian ($ A, $ B){$ SQL = "select 'R'. *, 'A'. 'articlename', 'A'. 'author'From 'phpsir _ record1 ''r'' inner join 'jieqi _

PHP object-oriented method reloading comparison between two versions

Multiple Functions use the same name, but the parameter table, that is, the number of parameters or (and) data types can be different. Although the method name is the same during the call, however, the corresponding function can be automatically

PHP Include, include_once, require, require_once

Include_once is similar to require_once. It is used to check whether the contained file has been included. If so, it will not be executed. Otherwise, it will be included again. the reason for this is that if you have clarified include and require.

PHP special character processing functions

But we can replace it with regular expressions: CopyCodeThe Code is as follows: Function dhtmlspecialchars ($ string ){ If (is_array ($ string )){ Foreach ($ string as $ key => $ Val ){ $ String [$ key] = dhtmlspecialchars ($ Val ); } } Else {

PHP generates HTML static page instance code

Developed for cd2sc.com Website Functions, Code It is original to me and the generation speed is average. (For a well-known reason, the data field name involved in the database has been changed, and the parameter filtering is removed for the sake

PHP project package method page 1/2

Enterprise websites require at least one virtual host. However, OA, finance ...... These internal systems are hard to say. Code And the database to people, write a description, let them follow the instructions to configure the environment, install

PHP spoofing Referer instance code

The complete Program You can modify the specific application. The example I provided here is very simple. In fact, many applications can be shown in this example. For example, hiding a real URL ...... Hey, let's analyze it by yourself. Create a

PHP online encryption and decryption program written by wiki-shan

A simple decryption is written for eval. This principle is very useful. Write it down here. CopyCode The Code is as follows: /* Author: zhiwushan Data: 20080411 */ // Encrypted File Content $ A =" Eval (gzinflate (str_rot13 (base64_decode

Common Array Processing Methods in PHP instance analysis

1. array_shift () removes the first unit of the array and returns the result. This is convenient for the first unit of the array to be processed independently. CopyCode The Code is as follows: $ Tmparray = array ("1", "2", "3", "4 "); $ Tmparray

Total Pages: 12780 1 .... 9255 9256 9257 9258 9259 .... 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.