displays all items in the shopping cart
Include ("shoppingcart. php ");$ Cart = new cart;$ Table = "shopping ";
/* Query and display information in all inventory Tables */$ Query = "select * from inventory ";$ Invresult = mysql tutorial _ query ($ query );If (! ($ Invresult )){Echo "query failed";Exit;}Echo "the following products are available for subscription ";Ec
One, random number and timeRandom number generator (JS:math.random)echo rand ();Generate a random number in a rangeecho rand (0,10);Time stampecho Time ();Format the display of timeecho "echo Date ("Y-m-d h:i:s", Time ());echo "echo Date ("Y-m-d h:i:s", "101506494366");Convert String to Timestampecho "
Dhesi# The script is modified .)
Sed '/^ end/,/^ begin/d' file1 file2... fileX | uudecode # vers. 1Sed '/^ end/,/^ begin/d' "$ @" | udecode # vers. 2# Sort the paragraphs in the file alphabetically. Paragraphs are separated by (one or more) blank rows. Use GNU sed# The character "\ v" is used to represent vertical tabs. It is used as a placeholder for line breaks-you can also# Replace it with other characters that are not used in the file.Sed '/. /{H
URL)
File_put_contents ()-? Writing a string to a file is the same as calling the fopen (), fwrite (), and fclose () functions in turn.
File_put_contents (file name, write data)
Feof () -- test whether the file pointer is at the end of the file
Ftell () -- returns the read/write position of the file pointer.
Syntax format: ftell (file pointer)
Flock ()-Lightweight consultation file locking
Syntax format: flock (file pointer, control parameter)
File pointer: it is a file pointer control param
Some shopping cart will use PHP filesMain. php display productAdditem. php add items to the shopping cartCearcart. php delete the item in the shopping cartShoppingcart. php operation classUser database tutorials include: The code is as follows:Copy code InventoryCreate table inventory (Product tinytext not null,Quantity tinytext not null,Id int (4) default '0' not null auto_increment,Description tinytext not null,Price float (10, 2) defaul
Shell may often see: Echo log>/dev/null 2> 1
Command results can be defined in the form of %>/Dev/null: Indicates an empty device file.>: Indicates the redirection location, for example, Echo "123">/home/123.txt1: Indicates stdout standard output. The default value is 1. T
pointer.Syntax format: ftell (File pointer)Flock ()-lightweight consultation file lockingSyntax format: flock (File pointer, control parameter)File pointer: it is a file pointer control parameter that has been opened (fopen:"LOCK_SH" indicates that the shared lock (read program) is to be obtained (Set 1 in PHP4.0.1 or earlier versions )."LOCK_EX" indicates to obtain an exclusive lock (Write Program) (set to 2
1. while Loop
In this lesson, we will continue to use PHP and MySQL to write some simple and useful pages. We started to display the data in the database from the database we created yesterday, but it will be slightly improved.
First, we use the following code to query the database content.
$ # @ 60; html $ # @ 62;$ # @ 60; body $ # @ 62;$ #@ 60 ;? Php$ Db = mysql_connect ("localhost", "root ");Mysql_select_db ("mydb", $ db );$ Re
Linux variables #, @, 0, 1, 2, *, $, $? Linux VariablesLinux variables #, @, 2, *, $, $
Let's first write a simple script and then explain the meaning of each variable after execution # touch variable # vi variable script content is as follows :#! /Bin/shecho "number :#"
Echo "scname: 0"
) tasks:
The code is as follows:
Function task1 (){For ($ I = 1; $ I Echo "This is task 1 iteration $ I. \ n ";Yield;}}
Function task2 (){For ($ I = 1; $ I Echo "This is task 2 iteration $ I. \ n ";Yield;}}
$ Scheduler = new S
.
CRYPT_EXT_DES-extended DES encoding, which is a 9-character salt.
CRYPT_MD5-MD5 encoding, input 12 characters plus $1 $ salt.
CRYPT_BLOWFISH-extended DES encoding. input 16 characters plus $2 $ salt.
In addition, if the salt parameter is not used, the program will automatically generate it.
Return value: None
Function types: PHP system functions
Description: This function outputs strings. Because it is
single command
Listing 1 demonstrates one of the most common UNIX bad habits: defining a directory tree at a time.
Listing 1. Bad habits 1 Example: define each directory tree separately
~ $ Mkdir TMP~ $ CD TMP~ /Tmp $ mkdir~ /Tmp $ CD~ /Tmp/A $ mkdir B~ /Tmp/A $ CD B~ /Tmp/a/B/$ mkdir C~ /Tmp/a/B/$ CD C~ /Tmp/A/B/C $
Using the-P option of mkdir and creati
-5A x-cp866D x-cp866M-x-mac-cyrillic
Syntax: string crypt (string str, string [salt]);Return Value: StringFunction Type: EncodingDescription: This function encrypts the string with the standard DES module of UNIX. This is a one-way encryption function and cannot be decrypted. To compare the string, place the first two characters of the encrypted string in the salt parameter, and then compare the encrypted string.For more information, see crypt in UNIX Manual (man.In some newer UNIX versions, apa
optional tag, which will cause the program to exit the statement with this tag. JavaScript does not allow line breaks between break keywords and labels. An expression statement can assign values to one or more variables or members, call a method, or delete an attribute from an object. Operator = is used to assign values. Do not confuse it with constant and other operators =. Operator + = can be used for addition operations or connection strings.
2.6
Expression Ternary operator? There are thr
) {Die ("I am chicken feathers, I cannot");}?>
If you can write it, you can use the File_put_contents function to write:
The code is as follows
Copy Code
$file = ' dirlist.php ';if (is_writable ($file) = = False) {Die (' I'm chicken feathers, I can't ');}$data = ' I am contemptible, I want ';File_put_contents ($file, $data);?>
The newly introduced function of the file_put_contents function in PHP5 (if you don't know it, use the Function_exists fun
Php is arranged in the order of 1, 2, 3, or 4, 5. if there is a string of numbers 1, 2, 3, 7, 8, how can we divide 123 into a group, let's divide 7, 8 into another group, namely, separating 1, 2, 3 and 7.8 ------ solution --------
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.