WorksheetsComputer Programming 3 Midterm exam
Total questions: 45
Worksheet time: 33mins
What does HTML stand for?
Hyper Text Makeup Language
Hyper Text Markup Language
High Text Markup Language
Hyperlinks Text Managing Language
The <html> element is known as the:
Title element
Header element
Root element
Body element
Which tag defines the document’s visible content?
<head>
<html>
<body>
<p>
What tag defines a large heading in HTML?
<heading>
<h1>
<h>
<head>
The <p>
tag in HTML defines:
Paragraph
Picture
Page
What does declare?<!DOCTYPE html>
Document is HTML version 4
Document is HTML5
Document uses PHP
Document is XML
HTML elements are usually composed of:
Content only
Tags only
Start tag, content, and end tag
Attributes only
A web browser does not display:
HTML code
Page content
Images
Headings
The <title> element specifies:
The main heading of the page
The title shown in the browser tab
The document’s body
The page header
Which of the following is the correct structure of an HTML document?
The first version of HTML was invented in:
1989
1993
1995
2008
The official organization that developed HTML 4.01 is:
WHATWG
W3C
PHP Group
Mozilla
HTML 5 was officially recommended by W3C in what year?
2010
2014
2016
2017
The <a> tag is used to:
Insert images
Create links
Add alignment
Mark a paragraph
What attribute defines the destination of a hyperlink?
src
href
link
target
The correct syntax of an HTML link is:
<link href="url">text</link>
<a src="url">text</a>
<a href="url">text</a>
<hyperlink>text</hyperlink>
In HTML, images, hyperlinks, and text are all contained within the:
<head>
<body>
What text editor is recommended for learning HTML on Windows?
Word
Notepad
Dreamweaver
Sublime
HTML files are usually saved with which file extension?
.txt
.css
.html
.doc
Which encoding is preferred when saving an HTML file?
ASCII
UTF-8
ANSI
Unicode-16
What does PHP stand for?
Personal Home Page
Private Hosting Page
PHP: Hypertext Preprocessor
Programming Hypertext Page
PHP is executed on the:
Client
Browser
Server
Operating system
PHP files have what file extension?
.ph
.php
.phtml
.html
PHP can generate:
Static pages only
Dynamic page content
JavaScript files
Only text output
PHP can be used to:
Send and receive cookies
Design only CSS
Replace HTML
Build only offline applications
Which of the following is not a use of PHP?
Encrypt data
Create, read, and write files
Style web pages
Control user access
PHP is:
Free and open-source
Paid software
Used only in Linux
A desktop application
The official website for PHP is:
php.org
www.php.net
php.com
php.edu
PHP 7 introduced:
Fewer operators
Improved speed
Deprecated bind_param
Removal of MySQL
PHP 7 supports which new operator?
??
<=>
::
->
In PHP, $stmt refers to:
Static memory
Statement object
String handler
Stored table
The purpose of placeholders ? in an SQL query is to:
Comment code
Represent variables safely
End a query
Define column names
How many placeholders does this query have?
INSERT INTO items (name, description, price) VALUES (?, ?, ?)
1
2
3
4
The method used to bind variables to placeholders is:
$stmt->connect()
$stmt->bind_param()
$stmt->prepare()
$stmt->run()
In stmt−>bindparam( name, description, price);, what does “ssd” represent?
String data types
Variable names
Data type order
SQL fields
In bind_param type string, the letter d stands for:
Double
Decimal
Data
Default
The letter s in the bind_param type string represents:
String
Symbol
SQL
Static
Which function actually sends and runs the SQL query?
$stmt->execute()
$stmt->run()
$stmt->start()
$stmt->perform()
Which function frees memory and closes a prepared statement?
$stmt->exit()
$stmt->stop()
$stmt->close()
$stmt->end()
Prepared statements help protect against:
SQL injection
CSS conflicts
JavaScript errors
PHP syntax errors
What are the three main functions used in the prepared statement process?
prepare(), bind_param(), execute()
open(), close(), read()
define(), connect(), commit()
insert(), update(), delete()
The “s” type in bind_param corresponds to what kind of data?
Numeric
Text
Date
Boolean
Why use prepared statements?
They make SQL code longer
They reduce performance
They improve security
They skip variable binding
What happens if you don’t use prepared statements?
Code runs faster
SQL injection becomes possible
No effect on security
PHP refuses to run
mysqli->prepare() is used to:
Bind variables
Create a safe SQL statement
Execute the query
Encrypt user input
