logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • Explain when to use GET or POST. Provide example for both the ways.


  • Correct Answer
  • Both GET and POST are used to collect data from a form However, when security is desired $_POST should be used When the $_ POST variable is used, all variables used are NOT displayed in the URL Also, they have no restrictions to the length of the variables GET should be used when the interaction with the form is more like a question For eg firing a query etc POST should be used more often when the interaction is more like an order or the interaction changes the state of the resource POST example:
    Name: Age:
    On clicking submit the URL resembles to: https://wwwmysamplesitecom/samplephp The samplephp file can be used for catching the form data using $_POST Hello
    You are years old! GET EXAMPLE
    Name: Age:
    On clicking submit the URL resembles to : https://wwwmysamplesitecom/samplephp?name=jim&age=37 The samplephp file can be used for catching the form data using $_GET Hello
    You are years old! 


  • Technology problems


    Search Results


    • 1. What type of inheritance that PHP supports? Provide an example.
    • Discuss
    • 2. Explain how to create random passwords.
    • Discuss
    • 3. Explain how to store the uploaded file to the final location.
    • Discuss
    • 4. Explain how to send large amounts of emails with php.
    • Discuss
    • 5. Explain Superglobal variables in PHP .
    • Discuss
    • 6. How to set cookies in PHP?
    • Discuss
    • 7. What Is a Session in PHP?
    • Discuss
    • 8. How can we encrypt the username and password using PHP?
    • Discuss
    • 9. Explain the changing file permission and ownership using PHP's chmod() function.
    • Discuss
    • 10. Explain the working with directories using opendir(), readdirs(), closedir() along with examples.
    • Discuss


    Comments

    There are no comments.

Enter a new Comment