Basic PHP Tutorial--Learning Summary _php Tutorial

Source: Internet
Author: User

Basic PHP Tutorial-Learning Summary


One, PHP and forms

1.POST method to send data manually:

The two are partly different:

GET:

1. Send information together as part of a URL

2. Limited number of transfers

3. Public transmission, such as password information will be exposed

4. Create a form that can be added as a bookmark.

POST:

1. Delivery of information users cannot see


Usage examples:

HTML file: ws.html

   
 
  Test   

PHP File: handle.php

   
 
  Test
 
  $title =$_post[' title '; $name =$_post[' name ']; Print "

$title $name";? >

Input: MyName

Result: Hello Mr myname

2.GET transmitting data

   
 
  Test 
 
  
  
  • "Handle.php?name=charles" >charles

PHP File: handle.php

   
 
  Test
 
  $name =$_get[' name '];p rint "

Hello $name ";? >

  


Second, the correlation function study

1. Format the values:

Round (the number to be formatted, the number of decimal places reserved);

eg: $test = 5.555555555; Round (test, 2); 5.55

Number_format (number, number of decimal places, symbol in place of decimal point, thousand separator)

Eg:number_format ("10000000", 2, ",", "."); /10.000.000,00

2. Random function rand ()

Eg:rand (0, 100);//Generate 0-100 random one number


http://www.bkjia.com/PHPjc/953328.html www.bkjia.com true http://www.bkjia.com/PHPjc/953328.html techarticle PHP Basic Tutorial--Learning Summary One, PHP and form 1.POST methods to send data manually: The two parts of the difference: get:1. To gather information as part of a URL 2. Limited number of transfers ...

  • 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.