Enhance your web development skills with this set of 30 multiple-choice questions focusing on HTML forms, PHP integration, GET vs POST methods, form validation, and handling user input with PHP. Ideal for learners!
<input><form><button><select>GETPOSTPUTaction attribute of the form tag.target attribute of the form tag.method to put.action to $_POST.type="text"type="checkbox"type="radio"type="button"methodactionurltarget$_GET['inputName']$_POST['inputName']$inputName$GET['inputName']<textarea><input type="text"><input type="password"><input type="file">name attribute in an HTML form element?
<input type="select"><select><dropdown><option>requiredvalidatenotnullemptypatternvalidatecheckconfirmif (empty($field))if (isset($field))if ($field == '')sanitize()filter_var()validate()clean()required attribute in HTML5 form inputs do?
<input type="text" email><input type="email"><input type="email" pattern="email"><input type="text" pattern="[a-zA-Z0-9@]+">is_numeric()is_string()is_integer()is_float()echo or print the error message.alert() the error message.| Qno | Answer |
|---|---|
| 1 | b) <form> |
| 2 | d) Both a and b |
| 3 | a) Using the action attribute of the form tag. |
| 4 | a) GET |
| 5 | b) type="checkbox" |
| 6 | b) action |
| 7 | b) $_POST['inputName'] |
| 8 | b) <input type="text"> |
| 9 | c) To associate form data with a variable in PHP. |
| 10 | b) <select> |
| 11 | b) Data is visible in the URL. |
| 12 | a) GET sends data in the URL, POST sends data in the body of the request. |
| 13 | b) POST |
| 14 | a) GET |
| 15 | b) Files |
| 16 | c) Around 8 KB |
| 17 | b) In the URL as query parameters |
| 18 | b) It exposes sensitive data in the URL. |
| 19 | a) 200 |
| 20 | a) Retrieving data without changing the server state. |
| 21 | a) required |
| 22 | a) To check for errors before data submission. |
| 23 | a) pattern |
| 24 | d) Both a and c |
| 25 | b) filter_var() |
| 26 | b) The form will be processed with empty data. |
| 27 | c) Prevents form submission if the field is empty. |
| 28 | b) <input type="email"> |
| 29 | a) is_numeric() |
| 30 | a) echo or print the error message. |