PHP Dynamic Web Development tips Sharing _php Tutorials

Source: Internet
Author: User
Many programmers are using the 1. Naming

    1. < input
    2. type = ' checkbox '
    3. name = ' checkbox[] '
    4. value = $dwmyrow [Banzhu]
    5. />

2. Use

When the plan is part of a SQL instruction: if the field that participates in the control is numeric, the

 
  
  
  1. {
  2. $ Expr Join(",", $_post[' checkbox ');
  3. $ SQL
    field in ($expr) ";
  4. }

If PHP Dynamic Web development says that the field participating in the control is numeric, then

 
  
  
  1. {
  2. $ Expr "'". Join ("', '", $_post
    [' checkbox ']). ".";
  3. $ SQL
    where field in ($expr) ";
  4. }

PHP determines whether a form form is submitted

 
  
  
  1. $ Action = $HTTP _post_vars["Button1"];
  2. if ($action= = "Commit" )
  3. {
  4. Perform form actions
  5. }
  6. Else
  7. {
  8. Read default values
  9. }

PHP gets string length in PHP Dynamic Web development

 
  
  
  1. Strlen ($myrow [1])

PHP URL Steering

 
  
  
  1. Header ("Location:".)
    $_server["Http_referer"]);

Hyper-Global objects in PHP Dynamic Web development

 
  
  
  1. <? PHP
  2. $ a 1;
  3. $ b 2;
  4. function Sum ()
  5. {

  6. $GLOBALS ["a"] + $GLOBALS ["B"];
  7. }
  8. Sum ();
  9. Echo $b;
  10. ?>

PHP form Values

If method= "get" uses $_get["test" instead of $test
If method= "POST" uses $_post["test" instead of $test

PHP Dynamic Web site development to obtain the current IP

 
  
  
  1. = $HTTP _server_vars["REMOTE_ADDR"]
  2. ?>

PHP Gets the current time

 
  
  
  1. Php
  2. echo Date ("y-m-d g:i:s");
  3. ?>
  4. Date ("Y year M month D Day")
  5. Date ("Y-n-j")

The above is the PHP Dynamic Web site development of specific techniques to explain.


http://www.bkjia.com/PHPjc/446290.html www.bkjia.com true http://www.bkjia.com/PHPjc/446290.html techarticle Many programmers are using 1, name input type = ' checkbox ' name = ' checkbox[] ' value = $dwmyrow [Banzhu]/2, use when planning as part of SQL instruction: If participating in controlled ...

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