Mastering PHP Fundamentals

Mastering PHP Fundamentals

12th Grade

10 Qs

quiz-placeholder

Similar activities

Anime

Anime

KG - University

10 Qs

​ Informatikquizziz (1) - "Brugertracking"

​ Informatikquizziz (1) - "Brugertracking"

12th Grade

10 Qs

Word Press

Word Press

9th - 12th Grade

10 Qs

Review Quiz #2- Productivity Tools

Review Quiz #2- Productivity Tools

11th - 12th Grade

10 Qs

Administrasi Server Jaringan

Administrasi Server Jaringan

12th Grade - University

15 Qs

Html dan css

Html dan css

12th Grade

10 Qs

Chapter 6 Part 2 - 4

Chapter 6 Part 2 - 4

11th - 12th Grade

11 Qs

Quiz - Quarter 4 (Oracle)

Quiz - Quarter 4 (Oracle)

12th Grade

10 Qs

Mastering PHP Fundamentals

Mastering PHP Fundamentals

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

B Prabhu Shankar VelTech

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?