Mastering PHP Fundamentals

Mastering PHP Fundamentals

12th Grade

10 Qs

quiz-placeholder

Similar activities

Post-Test Operator (Pemrograman Web Server-Side PHP)

Post-Test Operator (Pemrograman Web Server-Side PHP)

9th - 12th Grade

10 Qs

Soal BAB V PemWeb

Soal BAB V PemWeb

12th Grade

10 Qs

Horus Web I - Retour de formation

Horus Web I - Retour de formation

11th Grade - Professional Development

14 Qs

L.5. PHP FUNCTION AND ARRAY - 1

L.5. PHP FUNCTION AND ARRAY - 1

12th Grade

10 Qs

Dasar pemrograman PHP

Dasar pemrograman PHP

10th - 12th Grade

10 Qs

SESSION pada PHP

SESSION pada PHP

12th Grade

10 Qs

IT 105 (PHP+SQL)

IT 105 (PHP+SQL)

10th - 12th Grade

6 Qs

2.4 CONCEPTOS BÁSICOS DE PHP

2.4 CONCEPTOS BÁSICOS DE PHP

12th Grade

10 Qs

Mastering PHP Fundamentals

Mastering PHP Fundamentals

Assessment

Quiz

Computers

12th Grade

Hard

Created by

B Prabhu Shankar VelTech

Used 1+ times

FREE Resource

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, '/');

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?