Below are 100 multiple-choice questions based on the provided PDF content.
Each
question includes 4 options and the correct answer:
### **HTML Basics**
1. **What does HTML stand for?**
A. Hyperlinks and Text Markup Language
B. Home Tool Markup Language
C. Hyper Text Markup Language
D. Hyper Transfer Markup Language
**Answer: C**
2. **Which tag defines the root of an HTML document?**
A. `<head>`
B. `<body>`
C. `<html>`
D. `<!DOCTYPE>`
**Answer: C**
3. **Where is metadata placed in an HTML document?**
A. `<body>`
B. `<title>`
C. `<head>`
D. `<footer>`
**Answer: C**
4. **Which element is used for the main visible content of a webpage?**
A. `<head>`
B. `<meta>`
C. `<body>`
D. `<div>`
**Answer: C**
5. **What does the `<title>` tag define?**
A. Page header
B. Browser tab title
C. Footer text
D. Hyperlink destination
**Answer: B**
---
### **HTML Tags & Elements**
6. **Which tag creates the highest-level heading?**
A. `<h3>`
B. `<h1>`
C. `<h6>`
D. `<head>`
**Answer: B**
7. **How do you define a paragraph in HTML?**
A. `<par>`
B. `<pg>`
C. `<p>`
D. `<paragraph>`
**Answer: C**
8. **What does the `<br>` tag do?**
A. Inserts a horizontal line
B. Creates a line break
C. Bolds text
D. Links to another page
**Answer: B**
9. **Which tag creates a horizontal line?**
A. `<line>`
B. `<hl>`
C. `<hr>`
D. `<break>`
**Answer: C**
10. **What is the purpose of the `<pre>` tag?**
A. Preview text
B. Preserve formatting and spacing
C. Create a hyperlink
D. Insert an image
**Answer: B**
---
### **HTML Attributes & Links**
11. **Which attribute defines a hyperlink destination?**
A. `src`
B. `link`
C. `href`
D. `url`
**Answer: C**
12. **To open a link in a new tab, use:**
A. `target="_self"`
B. `target="_blank"`
C. `target="_parent"`
D. `target="_top"`
**Answer: B**
13. **Which tag inserts an image?**
A. `<img>`
B. `<image>`
C. `<pic>`
D. `<src>`
**Answer: A**
14. **The `alt` attribute in images is used for:**
A. Alignment
B. Alternative text for accessibility
C. Animation
D. Anchor text
**Answer: B**
15. **To link to a section within the same page, use:**
A. `<a name="section"></a>`
B. `<a href="#section">Go</a>`
C. `<a link="section">Go</a>`
D. `<a id="section">Go</a>`
**Answer: B**
---
### **HTML Lists & Tables**
16. **Which tag creates an unordered list?**
A. `<ol>`
B. `<ul>`
C. `<li>`
D. `<list>`
**Answer: B**
17. **To define a table row, use:**
A. `<tr>`
B. `<td>`
C. `<th>`
D. `<table>`
**Answer: A**
18. **The `colspan` attribute:**
A. Merges table rows
B. Merges table columns
C. Colors table cells
D. Aligns table content
**Answer: B**
19. **Which attribute sets a table border?**
A. `border="1"`
B. `frame="border"`
C. `style="border"`
D. `table-border="yes"`
**Answer: A**
20. **In ordered lists, `type="A"` produces:**
A. Lowercase letters
B. Uppercase letters
C. Roman numerals
D. Numbers
**Answer: B**
---
### **CSS Fundamentals**
21. **CSS stands for:**
A. Computer Style Sheets
B. Creative Style System
C. Cascading Style Sheets
D. Colorful Style Syntax
**Answer: C**
22. **To link an external CSS file, use:**
A. `<style src="[Link]">`
B. `<link rel="stylesheet" href="[Link]">`
C. `<css src="[Link]">`
D. `<import css="[Link]">`
**Answer: B**
23. **Which selector targets all `<h1>` elements?**
A. `.h1`
B. `#h1`
C. `h1`
D. `*h1`
**Answer: C**
24. **Class selectors in CSS start with:**
A. `#`
B. `%`
C. `.`
D. `@`
**Answer: C**
25. **To make text italic, use:**
A. `font-style: bold;`
B. `text-decoration: italic;`
C. `font-style: italic;`
D. `style: italic;`
**Answer: C**
---
### **JavaScript Basics**
26. **JavaScript is primarily a ______ language.**
A. Server-side
B. Client-side
C. Database
D. Markup
**Answer: B**
27. **How do you declare a variable in JavaScript?**
A. `v name;`
B. `var name;`
C. `variable name;`
D. `let name;`
**Answer: B**
28. **To output "Hello World" in JavaScript, use:**
A. `print("Hello World");`
B. `[Link]("Hello World");`
C. `alert("Hello World");`
D. Both B and C
**Answer: D**
29. **Comments in JavaScript start with:**
A. `<!--`
B. `//`
C. `/*`
D. `##`
**Answer: B**
30. **Which event triggers when a button is clicked?**
A. `onhover`
B. `onload`
C. `onclick`
D. `onsubmit`
**Answer: C**
---
### **PHP Fundamentals**
31. **PHP variables start with:**
A. `@`
B. `#`
C. `$`
D. `&`
**Answer: C**
32. **To output text in PHP, use:**
A. `print()`
B. `echo`
C. `printf()`
D. All of the above
**Answer: D**
33. **Which superglobal holds POST data?**
A. `$_GET`
B. `$_POST`
C. `$_REQUEST`
D. `$_DATA`
**Answer: B**
34. **To include a file in PHP, use:**
A. `include '[Link]';`
B. `require '[Link]';`
C. `import '[Link]';`
D. Both A and B
**Answer: D**
35. **What does `NULL` represent in PHP?**
A. Zero
B. Empty string
C. Absence of a value
D. False
**Answer: C**
---
### **Database & MySQL**
36. **To connect to MySQL in PHP, use:**
A. `mysqli_connect()`
B. `mysql_connect()`
C. `connect_db()`
D. `sql_connect()`
**Answer: A**
37. **Which SQL statement inserts data?**
A. `UPDATE`
B. `SELECT`
C. `DELETE`
D. `INSERT INTO`
**Answer: D**
38. **To fetch data from a database in PHP, use:**
A. `mysqli_fetch_array()`
B. `mysql_query()`
C. `mysqli_select()`
D. `fetch_db()`
**Answer: A**
39. **Which clause filters records in SQL?**
A. `FILTER`
B. `WHERE`
C. `FIND`
D. `SEARCH`
**Answer: B**
40. **To delete a record in MySQL, use:**
A. `REMOVE`
B. `DROP`
C. `DELETE`
D. `ERASE`
**Answer: C**
---
### **Advanced HTML/CSS**
41. **Which tag defines a drop-down list?**
A. `<select>`
B. `<dropdown>`
C. `<list>`
D. `<option>`
**Answer: A**
42. **To create a submit button in a form, use:**
A. `<button type="submit">`
B. `<input type="submit">`
C. `<submit>`
D. Both A and B
**Answer: D**
43. **Which CSS property changes text color?**
A. `text-color`
B. `font-color`
C. `color`
D. `text-style`
**Answer: C**
44. **To make an element hidden, use:**
A. `visibility: none;`
B. `display: none;`
C. `hidden: true;`
D. `opacity: 0;`
**Answer: B**
45. **The `position: absolute;` property:**
A. Fixes an element relative to the viewport
B. Positions an element relative to its parent
C. Aligns text to the center
D. Floats an element left/right
**Answer: B**
---
### **JavaScript Functions & Events**
46. **How do you define a function in JavaScript?**
A. `func myFunction() {}`
B. `function myFunction() {}`
C. `def myFunction() {}`
D. `function = myFunction() {}`
**Answer: B**
47. **Which event occurs when a page finishes loading?**
A. `onclick`
B. `onchange`
C. `onload`
D. `onready`
**Answer: C**
48. **To validate a form before submission, use:**
A. `onsubmit` event
B. `onclick` event
C. `onvalidate` attribute
D. `[Link]()`
**Answer: A**
49. **`let` vs. `var` in JavaScript:**
A. `let` has block scope, `var` has function scope
B. `var` is newer than `let`
C. `let` is used only for strings
D. No difference
**Answer: A**
50. **Which method converts a string to lowercase?**
A. `[Link]()`
B. `[Link]()`
C. `[Link]()`
D. `[Link]("lower")`
**Answer: C**
---
### **PHP & MySQL Integration**
51. **To prevent SQL injection, use:**
A. `mysqli_real_escape_string()`
B. `htmlspecialchars()`
C. `strip_tags()`
D. All of the above
**Answer: A**
52. **Which PHP function returns the last inserted ID?**
A. `mysqli_last_id()`
B. `mysqli_insert_id()`
C. `last_id()`
D. `insert_id()`
**Answer: B**
53. **To get the number of rows in a result set, use:**
A. `mysqli_num_rows()`
B. `mysqli_row_count()`
C. `mysqli_count_rows()`
D. `num_rows()`
**Answer: A**
54. **Which attribute is required for file uploads?**
A. `method="get"`
B. `enctype="text/plain"`
C. `enctype="multipart/form-data"`
D. `action="[Link]"`
**Answer: C**
55. **Sessions in PHP start with:**
A. `session_begin()`
B. `session_start()`
C. `start_session()`
D. `session_init()`
**Answer: B**
---
### **Advanced Concepts**
56. **What does `rowspan` do in HTML tables?**
A. Merges columns
B. Merges rows
C. Colors rows
D. Adds padding
**Answer: B**
57. **Which PHP data type represents a key-value pair?**
A. Array
B. Object
C. String
D. Integer
**Answer: A**
58. **In CSS, `margin: 0 auto;` centers an element:**
A. Vertically
B. Horizontally
C. Both vertically and horizontally
D. Only text inside the element
**Answer: B**
59. **The `static` scope in PHP means a variable:**
A. Is accessible everywhere
B. Retains its value between function calls
C. Can only be used once
D. Is automatically deleted
**Answer: B**
60. **JavaScript `setInterval()` is used to:**
A. Delay code execution
B. Execute code repeatedly at intervals
C. Run code once after a delay
D. Stop code execution
**Answer: B**
---
### **Form Handling**
61. **Which HTML input type is for passwords?**
A. `<input type="text">`
B. `<input type="hidden">`
C. `<input type="password">`
D. `<input type="secret">`
**Answer: C**
62. **To create a checkbox, use:**
A. `<input type="check">`
B. `<input type="radio">`
C. `<input type="checkbox">`
D. `<checkbox>`
**Answer: C**
63. **The `required` attribute in forms:**
A. Makes a field optional
B. Forces a field to be filled
C. Hides a field
D. Validates email format
**Answer: B**
64. **In PHP, form data sent via GET is accessed using:**
A. `$_GET[]`
B. `$_POST[]`
C. `$_REQUEST[]`
D. `$GET[]`
**Answer: A**
65. **To handle form submissions in PHP, check:**
A. `$_SERVER["REQUEST_METHOD"]`
B. `$_FORM["submitted"]`
C. `$POST["submit"]`
D. `isset($_GET)`
**Answer: A**
---
### **Miscellaneous**
66. **Which tag plays background audio in IE?**
A. `<audio>`
B. `<sound>`
C. `<bgsound>`
D. `<embed>`
**Answer: C**
67. **The `alt` attribute in images is important for:**
A. SEO
B. Accessibility
C. Broken image fallback
D. All of the above
**Answer: D**
68. **PHP `str_replace()` is used to:**
A. Split strings
B. Replace text in a string
C. Compare strings
D. Concatenate strings
**Answer: B**
69. **JavaScript `parseInt()` converts a string to:**
A. Float
B. Integer
C. Boolean
D. Array
**Answer: B**
70. **Which CSS unit is relative to the font size?**
A. `px`
B. `em`
C. `cm`
D. `%`
**Answer: B**
---
### **Debugging & Validation**
71. **To display PHP errors, use:**
A. `error_reporting(E_ALL);`
B. `display_errors = On;`
C. Both A and B
D. `debug(true);`
**Answer: C**
72. **Client-side form validation is done using:**
A. PHP
B. JavaScript
C. SQL
D. CSS
**Answer: B**
73. **The JavaScript `[Link]()` is used for:**
A. User alerts
B. Debugging in the console
C. Writing to HTML
D. Server logs
**Answer: B**
74. **Which function checks if a variable is empty in PHP?**
A. `is_null()`
B. `isset()`
C. `empty()`
D. `check_var()`
**Answer: C**
75. **HTML5 form validation for email uses:**
A. `type="email"`
B. `type="text"`
C. `validate="email"`
D. `format="email"`
**Answer: A**
---
### **Security & Best Practices**
76. **To hash passwords in PHP, use:**
A. `md5()`
B. `sha1()`
C. `password_hash()`
D. `encrypt()`
**Answer: C**
77. **Cross-Site Scripting (XSS) can be prevented by:**
A. `htmlspecialchars()`
B. `strip_tags()`
C. Validating inputs
D. All of the above
**Answer: D**
78. **Which SQL clause prevents injection attacks?**
A. `WHERE`
B. `PREPARE`
C. `ESCAPE`
D. Prepared statements
**Answer: D**
79. **The `secure` flag in cookies ensures:**
A. Cookies are sent only over HTTPS
B. Cookies expire quickly
C. Cookies are encrypted
D. Cookies are HTTP-only
**Answer: A**
80. **To destroy a PHP session, use:**
A. `session_destroy()`
B. `session_end()`
C. `session_remove()`
D. `delete_session()`
**Answer: A**
---
### **Advanced JavaScript**
81. **Which method adds an element to an array?**
A. `[Link]()`
B. `[Link]()`
C. `[Link]()`
D. `[Link]()`
**Answer: B**
82. **`[Link]()` returns:**
A. An array of elements
B. The first element with a class
C. A single element by ID
D. All elements in the DOM
**Answer: C**
83. **JavaScript `localStorage` stores data:**
A. Temporarily during page load
B. Permanently in the browser
C. On the server
D. In cookies
**Answer: B**
84. **The `this` keyword in JavaScript refers to:**
A. The function itself
B. The global object
C. The object that owns the function
D. The parent element
**Answer: C**
85. **To parse JSON in JavaScript, use:**
A. `[Link]()`
B. `[Link]()`
C. `[Link]()`
D. `json_parse()`
**Answer: A**
---
### **PHP Advanced**
86. **Which PHP function returns the current date?**
A. `time()`
B. `now()`
C. `date()`
D. `current_date()`
**Answer: C**
87. **To read a file in PHP, use:**
A. `file_open()`
B. `readfile()`
C. `file_get_contents()`
D. `open_file()`
**Answer: C**
88. **What does `===` operator do in PHP?**
A. Compares value only
B. Compares value and type
C. Assigns a value
D. Checks for inequality
**Answer: B**
89. **PHP namespaces are used to:**
A. Avoid naming conflicts
B. Encrypt code
C. Improve performance
D. Hide variables
**Answer: A**
90. **Which loop is best for arrays in PHP?**
A. `for`
B. `while`
C. `foreach`
D. `do-while`
**Answer: C**
---
### **Database Management**
91. **To sort SQL results, use:**
A. `FILTER BY`
B. `SORT`
C. `ORDER BY`
D. `ARRANGE`
**Answer: C**
92. **Which command deletes a table?**
A. `DELETE TABLE`
B. `TRUNCATE TABLE`
C. `DROP TABLE`
D. `REMOVE TABLE`
**Answer: C**
93. **The `LIMIT` clause in SQL is used to:**
A. Restrict the number of rows returned
B. Filter columns
C. Set permissions
D. Create backups
**Answer: A**
94. **Which join returns all rows from both tables?**
A. `INNER JOIN`
B. `LEFT JOIN`
C. `FULL OUTER JOIN`
D. `CROSS JOIN`
**Answer: C**
95. **To update multiple records in SQL, use:**
A. `MODIFY`
B. `ALTER`
C. `UPDATE`
D. `CHANGE`
**Answer: C**
---
### **Final Questions**
96. **Which HTML5 tag defines navigation links?**
A. `<nav>`
B. `<links>`
C. `<menu>`
D. `<navigate>`
**Answer: A**
97. **CSS `flexbox` is used for:**
A. Text styling
B. Responsive layouts
C. Animations
D. Print styles
**Answer: B**
98. **JavaScript `fetch()` is used to:**
A. Manipulate the DOM
B. Make HTTP requests
C. Validate forms
D. Create arrays
**Answer: B**
99. **PHP PDO (PHP Data Objects) is used for:**
A. Object-oriented programming
B. Database access
C. File handling
D. Session management
**Answer: B**
100. **The `viewport` meta tag is essential for:**
A. Desktop websites
B. Mobile responsiveness
C. Search engine indexing
D. Browser compatibility
**Answer: B**