zoukankan      html  css  js  c++  java
  • GET && POST

    If you looked closely at the removescore.php in #3

    you can find that we used both GET && POST in the same script.

    whats the differences between the GET and POST ? 

    when you want the script do the communication with each other, you might come to the idea

    of using GET.

    Data passed to a scirpt through a URL is available in the $_GET superglobal, which is an array very

    similar to $_POST. Packaging data into a linked URL is the same as using GET request

    in a web form.

    In traditional HTML GET request, form data is automatically sent along to the form processing 

    script as part of the script's URL. So we can do the same thing if we manually building our own

    GET request as a custom URL.

    There are some differences about the GET && POST :

    1. POST requests can only be initiated through a form, while GET requests can be packaged as URLs.

    2. The difference between GET and POST isn’t just form vs. URL since GET requests can (and often are)

    used to submit form data as well. The real distinction between GET and POST has to do

    with the intent of a request. GET is used primarily to retrieve data from the server

    without affecting anything on the server. POST, on the other hand, typically involves sending data

    to the server, after which the state of the server usually changes somehow in response to the data

    that was sent.

    So, generally speaking, GET is generally used for getting data from the server, not changing anything

    on the server. So GET is perfect for forms that make information requests on the server without 

    altering the state of the server, such as selecting rows from a database .

    POST, on the other hand, is best suited for requests that affects the server's state, such as issuing an

    INSERT or DELETE query that changes the database.

    3. Another distinction between GET and POST is that data passed through a GET is visible in a URL,

    while POST data is hidden, and, threrefore, POST is a bit more secure.

  • 相关阅读:
    使用Sed抽取MySQL安装文档的目录及行号
    [MySQL]关于Com_状态
    [译]理解对象存储如何工作
    [译]OpenStack Object Storage Monitoring
    通过设置swift中container的ACL提供匿名访问及用户授权读取服务
    使用swift命令遭遇503错误
    swift-get-nodes简单使用
    修改虚拟硬盘的大小
    php-fpm重启
    Windows学习"Network Analysis in Python"
  • 原文地址:https://www.cnblogs.com/beyond-Acm/p/4791587.html
Copyright © 2011-2022 走看看