
Mastering PHP Fundamentals
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
B Prabhu Shankar VelTech
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the correct way to start a PHP block?
php<?
>?php
<?php
<php>
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of the following is a valid variable name in PHP?
$1var
$var1
var-name
var@123
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
How do you connect to a MySQL database using PHP?
Connect using PDO with new PDO('mysql:host=host;dbname=database', 'username', 'password');
Use pg_connect('host', 'username', 'password', 'database');
Use mysqli_connect('host', 'username', 'password', 'database') or die('Connection failed: ' . mysqli_connect_error());
Use mysql_connect('host', 'username', 'password');
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What function is used to execute a SQL query in PHP?
mysqli_query() or PDOStatement::execute()
execute_query()
db_query()
run_sql()
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
How can you retrieve data from a form using the POST method in PHP?
Use the $_POST superglobal array to access form data.
Retrieve data using the $_REQUEST array only.
Data cannot be retrieved from a form using the POST method.
Use the $_GET superglobal array to access form data.
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the purpose of PHP sessions?
To enhance the speed of PHP execution.
To execute PHP scripts on the server side.
The purpose of PHP sessions is to maintain state and store user data across multiple pages.
To store files on the server permanently.
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
How do you set a cookie in PHP?
setcookie('name', 'value');
setcookie('cookie_name', 'cookie_value', time() + 3600, '/');
setcookie('name', 'value', time() - 3600, '/');
setcookie('name', 'value', 0, '/');
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Review Quiz #2- Productivity Tools
Quiz
•
11th - 12th Grade
15 questions
SLR 19 Legislation Data Protection Act
Quiz
•
12th Grade
15 questions
Twitter 101
Quiz
•
KG - 12th Grade
15 questions
Preguntas sobre SQL
Quiz
•
9th - 12th Grade
10 questions
Anime
Quiz
•
KG - University
15 questions
Learning SQL
Quiz
•
11th - 12th Grade
15 questions
Computer Hardware CPUs and Motherboards
Quiz
•
9th - 12th Grade
10 questions
JSPS Competition Hackathon - HTML Language Grade 4 & 5
Quiz
•
4th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
