wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITEDEV - Final Exam

Total questions: 105

Worksheet time: 48mins

Name
Class
Date
1.
What is the correct PHP function to connect to a MySQL database?
a)
mysql_connect()
b)
connect_mysql()
c)
mysqli_connect()
d)
db_connect()
e)
pdo_connect()
2.
Which superglobal is used to collect form data after submitting an HTML form with method='post'?
a)
$_GET
b)
$_REQUEST
c)
$_POST
d)
$_SESSION
e)
$_FORM
3.
Which SQL statement is used to insert new data in a database?
a)
INSERT INTO
b)
ADD DATA
c)
NEW RECORD
d)
UPDATE
e)
PUT DATA
4.
Which PHP function is used to execute a SQL query?
a)
mysqli_fetch()
b)
mysqli_query()
c)
execute_sql()
d)
run_query()
e)
query_db()
5.
Which HTML tag is used to create a form in PHP?
a)
<table>
b)
<div>
c)
<input>
d)
<form>
e)
<submit>
6.
Which attribute specifies where to send the form data?
a)
method
b)
action
c)
name
d)
target
e)
destination
7.
Which PHP function is used to start a session?
a)
start_session()
b)
session_begin()
c)
session_start()
d)
open_session()
e)
begin_session()
8.
What is the correct way to access a session variable named 'user'?
a)
$_SESSION(user)
b)
$_SESSION[user]
c)
$SESSION['user']
d)
$_SESSION['user']
e)
$_GET['user']
9.
What will the following code output: echo 5 . '5';
a)
55
b)
10
c)
Error
d)
5.5
e)
NULL
10.
Which SQL command is used to retrieve data from a table?
a)
GET
b)
FETCH
c)
RETRIEVE
d)
SELECT
e)
SHOW
11.
PHP is a client-side scripting language.
a)
True
b)
False
12.
HTML forms cannot interact with PHP scripts.
a)
True
b)
False
13.
mysqli_query() can be used to both read and write to the database.
a)
True
b)
False
14.
The 'name' attribute in form inputs is required to retrieve form data in PHP.
a)
True
b)
False
15.
In PHP, a session automatically starts when the user opens a page.
a)
True
b)
False
16.
What function is used to get the current date in PHP?
a)
now()
b)
date()
c)
time()
d)
getDate()
17.
Which format displays the date as '2025-05-17'?
a)
d/m/Y
b)
Y.m.d
c)
Y-m-d
d)
m/d/Y
18.
What does the 'L' format character in date() represent?
a)
Leap year
b)
Language
c)
Location
d)
Length of month
19.
What PHP function returns the current time in seconds?
a)
now()
b)
timestamp()
c)
microtime()
d)
time()
20.
Which SQL command imports CSV data efficiently?
a)
INSERT BULK
b)
LOAD DATA INFILE
c)
IMPORT CSV
d)
READ FILE
21.
What clause defines the file path in LOAD DATA INFILE?
a)
FROM FILE
b)
FILEPATH
c)
INFILE
d)
SOURCE
22.
Which HTML input type supports multiple file uploads?
a)
file
b)
multiple
c)
checkbox
d)
submit
23.
What function encrypts text in PHP?
a)
md5()
b)
password_hash()
c)
openssl_encrypt()
d)
crypt()
24.
What is the corresponding decryption function for openssl_encrypt()?
a)
decrypt()
b)
openssl_decrypt()
c)
base64_decode()
d)
reverse_encrypt()
25.
What does pagination improve in web applications?
a)
Security
b)
Speed
c)
User experience with large data
d)
Image rendering
26.
What is the purpose of OFFSET in SQL?
a)
Filter rows
b)
Skip rows
c)
Rename column
d)
Join tables
27.
What function sets the timezone in PHP?
a)
set_timezone()
b)
date_timezone_set()
c)
date_default_timezone_set()
d)
timezone_set()
28.
Which loop is best for inserting multiple rows in PHP?
a)
if
b)
foreach
c)
switch
d)
include
29.
What does date('z') return?
a)
Hour
b)
Seconds
c)
Day of year
d)
Month
30.
Which jQuery event detects real-time input?
a)
onclick
b)
onload
c)
onchange
d)
keyup
31.
What is a modal used for?
a)
Page refresh
b)
New page
c)
Popup interaction
d)
Server logs
32.
What method outputs a TCPDF PDF to browser?
a)
Output()
b)
RenderPDF()
c)
SendFile()
d)
echo()
33.
What attribute enables multiple selection in file upload?
a)
upload
b)
multi
c)
multiple
d)
many
34.
Which PHP function creates a custom date object?
a)
date_create()
b)
set_date()
c)
make_date()
d)
new_date()
35.
What clause in SQL limits the number of displayed rows?
a)
OFFSET
b)
WHERE
c)
LIMIT
d)
SORT
36.
The date() function in PHP can return both date and time.
a)
True
b)
False
37.
OFFSET in SQL defines the number of rows to display.
a)
True
b)
False
38.
LOAD DATA INFILE can import .csv files into MySQL.
a)
True
b)
False
39.
Encryption is irreversible.
a)
True
b)
False
40.
Modals reload the whole page when triggered.
a)
True
b)
False
41.
AJAX can send data without pressing a button.
a)
True
b)
False
42.
You can use TCPDF to generate formatted PDFs from PHP.
a)
True
b)
False
43.
Multiple file upload is enabled using enctype='multipart/form-data'.
a)
True
b)
False
44.
PHP’s time() function returns time in HH:MM:SS format.
a)
True
b)
False
45.
Prepared statements are safer than dynamic SQL in PHP.
a)
True
b)
False
46.
What does isset() do in PHP?
a)
Declares a variable
b)
Checks if a variable is set
c)
Compares values
d)
Defines a constant
47.
Which element is used to create a button in HTML?
a)
<btn>
b)
<button>
c)
<submit>
d)
<input type='text'>
48.
What PHP function is used to remove whitespace?
a)
remove_spaces()
b)
strip()
c)
escape()
d)
trim()
49.
Which superglobal is used to retrieve form data?
a)
$_GET
b)
$_POST
c)
$_FORM
d)
$_DATA
50.
How does PHP typically check if a button was clicked?
a)
$_CLICK
b)
isset($_POST['button_name'])
c)
onClick()
d)
button_clicked()
51.
What is the purpose of .htaccess?
a)
Style HTML
b)
Handle sessions
c)
Control web server settings
d)
Redirect to login
52.
Which PHP tag starts a block of code?
a)
<php>
b)
<?php ?>
c)
<script>
d)
<code>
53.
What directive is used for redirecting in .htaccess?
a)
GoTo
b)
Redirect
c)
Transfer
d)
MoveTo
54.
Which HTML tag is used to create links?
a)
<nav>
b)
<a>
c)
<link>
d)
<href>
55.
What does the ucfirst() function do?
a)
Makes string lowercase
b)
Capitalizes first letter
c)
Encrypts text
d)
Reverses string
56.
What is used to pass the ID in delete operations?
a)
$_POST
b)
$_GET
c)
$_SESSION
d)
$_DELETE
57.
What happens if you omit WHERE in DELETE SQL?
a)
Deletes one record
b)
Deletes all records
c)
No change
d)
SQL injection
58.
What does password_verify() do?
a)
Hashes passwords
b)
Compares plain and hashed passwords
c)
Encrypts password
d)
Decodes hash
59.
Where should session_start() be placed?
a)
Anywhere
b)
Before any HTML
c)
After HTML
d)
Inside <body>
60.
What is stored in $_SESSION['user']?
a)
Server info
b)
Session ID
c)
User login info
d)
Form data
61.
Which function removes all session data?
a)
session_end()
b)
session_unlink()
c)
session_destroy()
d)
session_reset()
62.
Where are uploaded files stored temporarily?
a)
htdocs
b)
public folder
c)
temporary directory
d)
images folder
63.
Which input type is used for file uploads?
a)
text
b)
file
c)
hidden
d)
upload
64.
Which attribute must a form have for uploads?
a)
method
b)
action
c)
enctype='multipart/form-data'
d)
class
65.
What function moves uploaded file in PHP?
a)
file_upload()
b)
move_file()
c)
move_uploaded_file()
d)
rename_file()
66.
isset() checks whether a variable exists and is not null.
a)
True
b)
False
67.
The <button> tag can only be used for form submission.
a)
True
b)
False
68.
Form validation is unnecessary if database is secure.
a)
True
b)
False
69.
.htaccess allows redirection and clean URLs.
a)
True
b)
False
70.
PHP can use the same login system for Admin and User.
a)
True
b)
False
71.
Passwords should be stored in plain text for easy retrieval.
a)
True
b)
False
72.
session_start() can be used anywhere in PHP file.
a)
True
b)
False
73.
Files uploaded should be validated for type and size.
a)
True
b)
False
74.
Navigation bars improve user experience on websites.
a)
True
b)
False
75.
Admin folders should be public to ease access.
a)
True
b)
False
76.
What PHP library is used to read Excel files?
a)
PhpSpreadsheet
b)
PHPExcel
c)
ExcelJS
d)
PDO
77.
Which PHP function is used to move uploaded files?
a)
upload_file()
b)
store_file()
c)
move_uploaded_file()
d)
save_as()
78.
What HTML attribute is required to upload Excel files?
a)
type='csv'
b)
name='upload'
c)
enctype='multipart/form-data'
d)
action='upload.php'
79.
What is the purpose of exporting data from a database?
a)
To delete old data
b)
To backup the server
c)
To generate reports in Excel
d)
To create new tables
80.
Which SQL statement is commonly used before exporting?
a)
INSERT
b)
SELECT
c)
UPDATE
d)
ALTER
81.
What is typically used to compute total price with checkboxes?
a)
radio buttons
b)
text fields
c)
checkboxes
d)
drop-downs
82.
What JavaScript function helps calculate real-time total?
a)
calculateSum()
b)
onchange()
c)
updateTotal()
d)
parseFloat()
83.
Which PHP function formats numbers for display?
a)
format_number()
b)
number_format()
c)
convert_to_float()
d)
round()
84.
Which Stripe key is safe to use in client-side code?
a)
secret_key
b)
database_key
c)
publishable_key
d)
server_token
85.
Which method processes Stripe transactions securely?
a)
Stripe::pay()
b)
Stripe::charge()
c)
Stripe API with keys
d)
form-submit()
86.
What file format is generated by TCPDF?
a)
.html
b)
.txt
c)
.xls
d)
.pdf
87.
Which function in TCPDF adds a page to the document?
a)
appendPage()
b)
AddPage()
c)
newPage()
d)
createPage()
88.
What method writes HTML-formatted text to a PDF in TCPDF?
a)
WriteHTML()
b)
writeText()
c)
insertText()
d)
echoPDF()
89.
Which button type is used to trigger data export?
a)
type='export'
b)
type='excel'
c)
type='submit'
d)
type='button'
90.
What must be done after exporting data to Excel?
a)
Save to PDF
b)
Redirect to dashboard
c)
Set download headers
d)
Encrypt the file
91.
Which element is used in HTML to upload files?
a)
<textarea>
b)
<input type='file'>
c)
<file-upload>
d)
<form-file>
92.
What output format is expected from PhpSpreadsheet?
a)
.doc
b)
.xlsx
c)
.csv
d)
.sql
93.
What library is commonly used in PHP for PDF generation?
a)
Html2PDF
b)
PDF.js
c)
TCPDF
d)
jQuery PDF
94.
What type of form is required for Stripe payment?
a)
HTML form with credit card
b)
AJAX-based
c)
Stripe embedded form
d)
PHP + HTML form with token
95.
Which action completes the Stripe payment flow?
a)
form-submit
b)
redirect()
c)
paymentIntent.confirm()
d)
POST only
96.
PhpSpreadsheet can import and export Excel files in PHP.
a)
True
b)
False
97.
move_uploaded_file() is used to download files from the web.
a)
True
b)
False
98.
Stripe’s publishable key should never be exposed to the client.
a)
True
b)
False
99.
TCPDF can generate Excel files as well as PDF.
a)
True
b)
False
100.
Checkbox input allows multi-selection in forms.
a)
True
b)
False
101.
PDFs generated in PHP can include images and tables.
a)
True
b)
False
102.
Stripe allows test payments using test card numbers.
a)
True
b)
False
103.
You don’t need any HTML form to upload Excel data.
a)
True
b)
False
104.
PhpSpreadsheet only works with .csv files.
a)
True
b)
False
105.
AJAX is required to export data from MySQL to Excel.
a)
True
b)
False