AMP

Chapter 8: Forms and Files — Online MCQ Test

COMPUTER APPLICATIONS · CLASS 12th · Tamil Nadu State Board
Practice Chapter 8: Forms and Files with a free chapter-wise online MCQ test. This chapter covers: Focusing on interactive web applications this chapter details HTML form processing with PHP GET and POST methods. Students learn file handling operations including opening reading.... AI-generated questions from basic to board-exam level, with instant results and explanations.

Start Exam on Full Site →

Chapter 8: Forms and Files — Important Questions & Answers

Which HTML element is commonly used to create a form for user input?
  • A. <form>
  • B. <input>
  • C. <table>
  • D. <body>
Answer: A. <form>
The <form> tag is used to define an HTML form that can collect user input and send it to a server.
In PHP, which method sends form data as part of the URL?
  • A. POST
  • B. GET
  • C. PUT
  • D. UPLOAD
Answer: B. GET
The GET method appends form data to the URL, so the values can be seen in the address bar.
Which method is generally preferred for sending sensitive form data such as passwords?
  • A. GET
  • B. POST
  • C. QUERY
  • D. LINK
Answer: B. POST
POST is preferred for sensitive data because the values are not shown in the URL.
Which of the following is NOT a valid advantage of the GET method?
  • A. Form data can be bookmarked in the URL
  • B. It is suitable for non-sensitive data
  • C. It can send large amounts of data safely
  • D. It allows data to appear in the address bar
Answer: C. It can send large amounts of data safely
GET is not suitable for large data because URL length is limited and the data is visible in the address bar.
Which statement about HTML form controls is correct?
  • A. The name attribute is required for PHP to receive the value of a form control
  • B. The id attribute alone is enough for PHP to read form input
  • C. The action attribute stores the form values in the browser
  • D. The method attribute determines the font style of the form
Answer: A. The name attribute is required for PHP to receive the value of a form control
PHP receives form values using the control's name attribute, because the submitted data is indexed by name.