Register|Login

Have a question? Click here to ask the community.

Quiz 21 – Get, Post, & Request

| In: PHP Quizzes | 25,043 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! :)

1. What is not a correct way to access the information the user types in the Age text field shown below:

   <html>
   <body>

       <form action="success.php" method="post">
       Age: <input type="text" name="age" />
       <input type="submit" />
       </form >

   </body>
   </html>

$_REQUEST[“age”];
$_POST[“age”];
$_GET[“age”];
$_REQUESTS[“age”];

2. A disadvantage for the GET method is that it has a limited amount of characters it can hold?

True
False

3. It is best to use the GET method when users have to type in a password or private information?

True
False

4. The $_REQUEST variable can retrieve the contents of both the $_GET and $_POST variable?

True
False

5. What will be displayed in a browser if a user typed in 21 in the text field and hit the submit button in the form coded below?

File: form.php
   <html>
   <body>

       <form action="success.php" method="post">
       Age: <input type="text" name="age" />
       <input type="submit" />
       </form >

   </body>
   </html>


File: success.php
   <html>
   <body>

       I am <?php echo $_REQUEST["age"]; ?> years old.

   </body>
   </html>

I am years old.
I am 21 years old.
I am $_REQUEST[“age”] years old.
None of the above

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 8 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments