WorksheetsQuiz 2 - ITEDEV - Final
Total questions: 30
Worksheet time: 12mins
Name
Class
Date
1.
What does isset() do in PHP?
a)
Declares a variable
b)
Checks if a variable is set
c)
Compares values
d)
Defines a constant
2.
Which element is used to create a button in HTML?
a)
<btn>
b)
<button>
c)
<submit>
d)
<input type='text'>
3.
What PHP function is used to remove whitespace?
a)
remove_spaces()
b)
strip()
c)
escape()
d)
trim()
4.
Which superglobal is used to retrieve form data?
a)
$_GET
b)
$_POST
c)
$_FORM
d)
$_DATA
5.
How does PHP typically check if a button was clicked?
a)
$_CLICK
b)
isset($_POST['button_name'])
c)
onClick()
d)
button_clicked()
6.
What is the purpose of .htaccess?
a)
Style HTML
b)
Handle sessions
c)
Control web server settings
d)
Redirect to login
7.
Which PHP tag starts a block of code?
a)
<php>
b)
<?php ?>
c)
<script>
d)
<code>
8.
What directive is used for redirecting in .htaccess?
a)
GoTo
b)
Redirect
c)
Transfer
d)
MoveTo
9.
Which HTML tag is used to create links?
a)
<nav>
b)
<a>
c)
<link>
d)
<href>
10.
What does the ucfirst() function do?
a)
Makes string lowercase
b)
Capitalizes first letter
c)
Encrypts text
d)
Reverses string
11.
What is used to pass the ID in delete operations?
a)
$_POST
b)
$_GET
c)
$_SESSION
d)
$_DELETE
12.
What happens if you omit WHERE in DELETE SQL?
a)
Deletes one record
b)
Deletes all records
c)
No change
d)
SQL injection
13.
What does password_verify() do?
a)
Hashes passwords
b)
Compares plain and hashed passwords
c)
Encrypts password
d)
Decodes hash
14.
Where should session_start() be placed?
a)
Anywhere
b)
Before any HTML
c)
After HTML
d)
Inside <body>
15.
What is stored in $_SESSION['user']?
a)
Server info
b)
Session ID
c)
User login info
d)
Form data
16.
Which function removes all session data?
a)
session_end()
b)
session_unlink()
c)
session_destroy()
d)
session_reset()
17.
Where are uploaded files stored temporarily?
a)
htdocs
b)
public folder
c)
temporary directory
d)
images folder
18.
Which input type is used for file uploads?
a)
text
b)
file
c)
hidden
d)
upload
19.
Which attribute must a form have for uploads?
a)
method
b)
action
c)
enctype='multipart/form-data'
d)
class
20.
What function moves uploaded file in PHP?
a)
file_upload()
b)
move_file()
c)
move_uploaded_file()
d)
rename_file()
21.
isset() checks whether a variable exists and is not null.
a)
True
b)
False
22.
The <button> tag can only be used for form submission.
a)
True
b)
False
23.
Form validation is unnecessary if database is secure.
a)
True
b)
False
24.
.htaccess allows redirection and clean URLs.
a)
True
b)
False
25.
PHP can use the same login system for Admin and User.
a)
True
b)
False
26.
Passwords should be stored in plain text for easy retrieval.
a)
True
b)
False
27.
session_start() can be used anywhere in PHP file.
a)
True
b)
False
28.
Files uploaded should be validated for type and size.
a)
True
b)
False
29.
Navigation bars improve user experience on websites.
a)
True
b)
False
30.
Admin folders should be public to ease access.
a)
True
b)
False
100 %
