Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Page 1

Total questions: 133

Worksheet time: 1hrs 7mins

Name
Class
Date
1.

A principal função da estrutura if em PHP é:

a)

Repetir um bloco de código em um loop

b)

Armazenar dados permanentemente no servidor

c)

Executar um bloco de código apenas se uma condição for verdadeira

d)

Definir a estrutura básica de uma página HTML

2.

Qual palavra-chave é usada para que o código execute um bloco alternativo quando a condição if é avaliada como falsa?

a)

then

b)

switch

c)

elseif

d)

else

3.

No exercício de classificação de idade dos atletas (Lição 1/4), qual classificação é dada para idades maiores ou iguais a 18?

a)

Equipe Adolescente

b)

Equipe Criança

c)

Equipe Bebê

d)

Equipe Adulto

4.

Para verificar se uma variável $idade é maior ou igual a 18 em PHP, qual operador de comparação dentro do if está correto?

a)

==

b)

>

c)

!=

d)

>=

5.

Se a variável numeroequals10,whatwillbedisplayedbythecode:<?phpif(numero equals 10, what will be displayed by the code: <?php if ( numero > 10) { echo "Maior"; } else { echo "Não é Maior"; } ?>

a)

Maior

b)

Não é Maior

c)

Erro de sintaxe

d)

Nada

6.

Se a condição if for verdadeira, o código dentro de qual par de símbolos será executado em PHP?

a)

Aspas ""

b)

Parênteses ()

c)

Colchetes []

d)

Chaves {}

7.

O que a Lição 1 (de 4) enfatiza como essencial para aprender programação?

a)

Memorizar todas as funções do PHP

b)

Fazer apenas design visual com CSS

c)

Ignorar a prática e focar apenas na teoria

d)

Programar requer sequenciamento lógico, treinamento e muita prática

8.

Se a variável $idade = 10, qual será a classificação do atleta de acordo com a lógica da Lição 1/4 (Equipe Infantil é para idades de 6 a 12)?

a)

Equipe Adulto

b)

Equipe Adolescente

c)

Equipe Bebê

d)

Equipe Infantil

9.

Qual instrução está correta para exibir a mensagem "Condição OK" na tela usando PHP?

a)

print("Condição OK")

b)

write("Condição OK")

c)

console.log("Condição OK")

d)

echo "Condição OK"

10.

A expressão dentro do if (a condição) geralmente retorna qual tipo de dado, determinando se o bloco será executado?

a)

String (texto)

b)

Inteiro (número)

c)

Float (decimal)

d)

Booleano (Verdadeiro/Falso)

11.

Que termo é usado para o servidor simulado em seu computador, acessado via navegador como http://localhost/... ?

a)

Servidor Apache

b)

Gerenciador XAMPP

c)

C:\xampp

d)

Localhost

12.

Em PHP, qual estrutura de controle condicional permite que o código seja executado quando a condição é falsa?

a)

else

b)

while

c)

if

d)

for

13.

Para a condição ($numero < 5), qual valor fará com que o bloco if seja executado?

a)

5

b)

10

c)

5,5

d)

4

14.

Onde os arquivos .php (como if_1.php da Lição 1) devem ser salvos na estrutura de pastas do XAMPP?

a)

C:\xampp\mysql\data

b)

C:\xampp\php

c)

C:\xampp\temp

d)

C:\xampp\htdocs

15.

O que significa o termo "estrutura de controle condicional"?

a)

Uma forma de definir o estilo CSS de uma página

b)

Um bloco de código que roda infinitamente

c)

Um sistema para conectar a um banco de dados

d)

Um mecanismo para decidir qual bloco de código executar com base em uma condição

16.

O que significa a sigla PHP?

a)

Página Pessoal Inicial

b)

Páginas de Hipertexto de Programação

c)

Plataforma Pública de Hospedagem

d)

Pré-processador de Hipertexto

17.

Onde o código PHP é executado principalmente?

a)

No navegador do cliente (front end)

b)

Em um banco de dados MySQL

c)

No servidor (back end)

d)

Em um arquivo CSS

18.

Qual é a principal função do PHP no desenvolvimento web?

a)

Estilizar páginas web (CSS)

b)

Criar estrutura estática (HTML)

c)

Criar páginas dinâmicas que interagem com bancos de dados

d)

Adicionar interatividade do lado do cliente (JavaScript)

19.

Which opening and closing tags are used to delimit PHP code?

a)

and

b)

and

c)

`

d)

20.

Qual caractere deve ser usado para declarar uma variável em PHP?

a)

#

b)

&

c)

@

d)

$ (sinal de cifrão)

21.

Qual comando é mais comum em PHP para imprimir ou exibir saída em uma página da web?

a)

print()

b)

display()

c)

write()

d)

echo

22.

O que o ponto e vírgula (;) representa no final de uma instrução em PHP?

a)

O início de um novo bloco de código

b)

A separação entre o código HTML e PHP

c)

Uma quebra de linha em HTML

d)

O fim de uma instrução ou comando

23.

Qual tipo de dado do PHP representa um valor com casas decimais (por exemplo, 3.14)?

a)

Inteiros

b)

Strings

c)

Booleano

d)

Floats

24.

Qual tipo de dado representa um valor verdadeiro ou falso em PHP?

a)

Floats

b)

Inteiros

c)

Strings

d)

Booleano

25.

O código PHP geralmente é incorporado em qual outra linguagem?

a)

JavaScript

b)

SQL

c)

CSS

d)

HTML

26.

Quem foi o criador inicial do PHP em 1993, com a primeira versão lançada em 1995?

a)

Linus Torvalds

b)

Bill Gates

c)

James Gosling

d)

Rasmus Lerdorf

27.

Para a variável $cidade = 'São Paulo'; qual é o tipo de dado?

a)

Inteiro

b)

Float

c)

Booleano

d)

String

28.

Qual pacote de software gratuito que inclui Apache, MySQL e PHP é recomendado para simular um servidor web local?

a)

WAMP

b)

LAMP

c)

MAMP

d)

XAMPP

29.

Qual tipo de dado representaria a idade de uma pessoa (por exemplo, 25) em PHP?

a)

Floats

b)

Strings

c)

Boolean

d)

Inteiros

30.

O que significa o termo "páginas dinâmicas" em PHP?

a)

Páginas com muitas imagens em movimento

b)

Páginas que não mudam

c)

Páginas que usam apenas CSS

d)

Páginas que podem interagir com bancos de dados e responder de forma diferente dependendo do usuário ou do conteúdo

31.

Em PHP, qual operador é usado para multiplicação?

a)

+

b)

-

c)

*

32.

Na expressão matemática 2+2∗42 + 2 * 4 , qual é o resultado ao aplicar a precedência de operadores (multiplicação antes da adição)?

a)

16

b)

4

c)

10

d)

8

33.

Em PHP, qual operador é usado para concatenar strings e variáveis?

a)

&

b)

+

c)

#

d)

Ponto (.)

34.

Dado e , qual código exibirá Ana Silva com um espaço entre o primeiro e o último nome?

a)

echo nome+nome + sobrenome;

b)

echo nome:nome: sobrenome;

c)

echo nome:nome: sobrenome;

d)

echo sobrenome;

35.

Qual operador é usado para divisão em PHP?

a)

\

b)

//

c)

%

d)

/

36.

Se $numero = 7, qual expressão PHP calcula o triplo desse valor?

a)

triplo=triplo = numero + 3;

b)

triplo=triplo = numero - 3;

c)

triplo=triplo = numero / 3;

d)

triplo=triplo = numero * 3;

37.

Em PHP, qual operador realiza a adição?

a)

x

b)

**

c)

-

d)

+

38.

O que a Lição 3 enfatiza sobre a precedência das operações em cálculos matemáticos no PHP?

a)

Todas as operações têm a mesma prioridade.

b)

A adição sempre tem prioridade sobre a multiplicação.

c)

O PHP ignora as regras de precedência.

d)

Multiplicação e divisão têm prioridade sobre adição e subtração.

39.

Se var1=10evar1 = 10 e var2 = 5, qual é o resultado de var1−var1 - var2?

a)

15

b)

50

c)

10

d)

5

40.

Qual é a saída de echo "O valor total é " . 50 . " reais"; ?

a)

O valor total é 50+reais

b)

Erro de sintaxe

c)

O valor total é 50

d)

O valor total é 50 reais

41.

Qual é o principal benefício da concatenação em PHP?

a)

Aumentar a segurança do código.

b)

Reduzir o uso de memória.

c)

Realizar cálculos complexos.

d)

Exibir informações dinâmicas de forma legível e formatada na tela.

42.

Qual operador calcula o resto da divisão entre dois números (módulo)?

a)

/

b)

*

c)

#

d)

%

43.

Se a=20ea = 20 e b = 3, qual é o resultado de aa % b?

a)

6,66

b)

20

c)

6

d)

2

44.

Ao concatenar uma variável numérica com uma string, o que o PHP faz?

a)

Lança um erro de tipo.

b)

Converte a string em um número.

c)

Ignora o número.

d)

Converte temporariamente o número em uma string para realizar a concatenação.

45.

XAMPP é um pacote de software gratuito que inclui quais recursos essenciais para executar PHP?

a)

Windows, Apache, MySQL, Photoshop

b)

Linux, Apache, MySQL, Perl

c)

Apache, MySQL, PHP, Perl

d)

Apache, PostgreSQL, Python, Java

46.

Qual é o propósito do elseif em um bloco condicional?

a)

Executar o código após o bloco else.

b)

Repetir o código em um loop.

c)

Verificar uma segunda ou adicional condição se o primeiro if for falso.

d)

Inserir dados em um banco de dados.

47.

Qual é a principal vantagem de usar if/elseif/else em vez de várias instruções if separadas?

a)

É mais rápido digitar o código.

b)

elseif só aceita inteiros.

c)

Ele avalia condições mutuamente exclusivas de forma mais clara e evita verificações redundantes.

d)

Ele otimiza automaticamente o desempenho sem intervenção do desenvolvedor.

48.

No exemplo da Lição 4, para verificar se um número é positivo, qual condição lógica deve ser usada?

a)

$numero <= 0

b)

$numero == 0

c)

$numero < 0

d)

$numero > 0

49.

Se o valor da variável numeroeˊ−5,qualblocodecoˊdigoseraˊexecutadoquandoocoˊdigoutilizaif(numero é -5, qual bloco de código será executado quando o código utiliza if ( numero > 0), elseif ($numero == 0), e else?

a)

O bloco if.

b)

O bloco elseif.

c)

O bloco else (Negativo).

d)

Nenhum bloco.

50.

A estrutura de controle condicional (if/else) é definida como um mecanismo que executa um bloco de código apenas se uma condição for:

a)

Verdadeira.

b)

Igual a zero.

c)

Não nula.

d)

Falsa.

51.

Qual é a sintaxe correta para verificar uma condição intermediária em PHP?

a)

else if ($condicao)

b)

else ($condicao)

c)

elseif ($condicao)

d)

else ife ($condicao)

52.

In the athlete age classification exercise, which age range corresponds to the classification "Teen Team"?

a)

Age greater than or equal to 18 years.

b)

Age less than 6 years.

c)

Age 6 to 12 years.

d)

Age 13 to 17 years.

53.

If an athlete is 5 years old, which classification will they receive according to the conditions from Lesson 4?

a)

Child Team

b)

Teen Team

c)

Adult Team

d)

Baby Team (under 6 years)

54.

Which comparison operator means "not equal to" in PHP?

a)

==

b)

>=

c)

<=

d)

!= or <>

55.

If a=10anda = 10 and b = 10, what is the result of the expression a==a == b?

a)

False

b)

10

c)

True

d)

20

56.

What happens if the variable $numero is 0 in the Positive/Negative/Zero test that uses elseif?

a)

The if block ($numero > 0) runs.

b)

The else block runs.

c)

The elseif block ($numero == 0) runs.

d)

It produces an error.

57.

Including a PHP code file inside another file is often done using which command?

a)

echo

b)

if

c)

else

d)

include or require

58.

In the athlete classification exercise, if the age is 12, what will the classification be?

a)

Adult Team

b)

Teen Team

c)

Baby Team

d)

Child Team (6 to 12 years)

59.

What does the term "good programming practices," mentioned in Lesson 4, suggest?

a)

That it is not necessary to save the examples.

b)

That HTML code is more important than PHP.

c)

That you must memorize the code.

d)

Follow the examples, practice, and take notes.

60.

What does the condition if ( idade < 18) mean in logical terms?

a)

Age is less than 12 OR greater than 18.

b)

Age is less than or equal to 12.

c)

Age is 12 or 18.

d)

Age is between 13 and 17 (greater than 12 and less than 18).

61.

In which form submission method are the data transferred more securely (not appearing in the URL)?

a)

GET

b)

SESSION

c)

COOKIE

d)

POST

62.

What is the name of the PHP superglobal array used to receive data from a form submitted via the POST method?

a)

$_GET

b)

$_SERVER

c)

$_SESSION

d)

$_POST

63.

In the flow of Lesson 5, which PHP page is responsible for receiving the data and performing the bonus calculation using if/else logic?

a)

form3.php

b)

index.html

c)

conexao.php

d)

resultado.php

64.

What was the minimum sales value (condition) for the employee to receive a bonus of R$ 500.00?

a)

R$ 5,000.00

b)

R$ 9,999.99

c)

R$ 15,000.00

d)

R$ 10,000.00

65.

If sales are set as vendas=9500,whatdoesthelogicif(vendas = 9500, what does the logic if ( vendas >= 10000) do?

a)

The employee will receive the bonus of R$ 500.00.

b)

The $vendas variable will be updated.

c)

An error message will be displayed.

d)

The else block will run (message indicating the target was not met).

66.

In PHP, when receiving the sales field from a form, which syntax correctly stores it in the variable $vendas?

a)

vendas=vendas = _GET['vendas'];

b)

vendas=vendas = _POST.vendas;

c)

POST[′vendas′]=_POST['vendas'] = vendas;

d)

vendas=vendas = _POST['vendas'];

67.

What does Lesson 5 emphasize about the importance of using forms in web development?

a)

They are used only for design purposes.

b)

They are used only to send emails.

c)

They serve only to test CSS.

d)

They enable collecting user information for processing and dynamic interaction.

68.

In the form (form3.php), what is the action attribute used for?

a)

Define the type of field.

b)

Define the submission method.

c)

Define the field name.

d)

Indicate which page the data will be sent to (e.g., resultado.php).

69.

Which code snippet allows the user to return to the form from the resultado.php page?

a)

b)

c)

70.

For which form field was the variable $setor used to receive the value?

a)

Name

b)

Sales

c)

Bonus

d)

Sector

71.

What is the main resource used by the code echo "Olá Funcionário(a) nome,setor:nome, setor: setor, veja sua Bonificação:

"?

a)

Conditional structures.

b)

File manipulation.

c)

Mathematical operations.

d)

Concatenation and display of variables.

72.

If the form’s method attribute is omitted, by which method are the data sent by default?

a)

GET

b)

POST

c)

SESSION

d)

PUT

73.

Which of the following is not a PHP superglobal?

a)

$_POST

b)

$_GET

c)

$_SESSION

d)

$_ARRAY

74.

On the resultado.php page, the variable $vendas receives the value from the form. Which line of code displays the value of this variable?

a)

if ($vendas >= 10000)

b)

vendas=vendas = _POST['vendas'];

c)

echo "Você receberá uma bonificação...";

d)

echo $vendas; (when used outside the main string)

75.

In the Lesson 5 form, what is the purpose of the name attribute on an HTML input?

a)

Define the visual style.

b)

Define the data type.

c)

Determine the submission method.

d)

Identify the field so PHP receives it via $_POST['nome'].

76.

What is the main objective of Lesson 6?

a)

Connect to and query a database.

b)

Send automated emails.

c)

Create interactive charts.

d)

Collect form data and save it to a .txt file.

77.

What is the native PHP function file_put_contents() used for?

a)

Only to read a file’s content.

b)

Only to open a file for writing.

c)

Move a file between folders.

d)

Create a text file and write content to it.

78.

In the file-writing flow, which function is used to generate a date–time string to create unique filenames (e.g., dados_20250506_150102.txt)?

a)

time()

b)

unique_id()

c)

datetime()

d)

date("Ymd_His")

79.

Which condition is used on the processing page (dados.php in Lesson 6) to ensure the code runs only if the form was submitted via POST?

a)

$_POST["name"] != ""

b)

if (isset($_POST))

c)

if ($conteudo != "")

d)

$_SERVER["REQUEST_METHOD"] == "POST"

80.

In the data-processing code for the .txt file, which structure is used to loop through the $_POST array and extract the field name and the entered value?

a)

for

b)

while

c)

if

d)

foreach

81.

What does the concatenation \n represent inside the content string that will be written to the .txt file?

a)

A tab (large space).

b)

The end of the file.

c)

A division slash.

d)

A line break.

82.

In Lesson 6, the $conteudo variable is responsible for:

a)

Storing the file name.

b)

Defining the page’s HTML structure.

c)

Storing database connection details.

d)

Concatenating all form information into a single string that will be written to the file.

83.

Why is it important to use a function like date("Ymd_His") to name the generated text files?

a)

To define the file type.

b)

To encrypt the file.

c)

So that PHP can read the file.

d)

To prevent new submissions from overwriting old files, ensuring uniqueness.

84.

In the code that iterates over POSTwithforeach,the_POST with foreach, the chave (field name) variable stores:

a)

The value entered by the user.

b)

The .txt filename.

c)

The date and time.

d)

The form field’s name attribute.

85.

If the validation $_SERVER["REQUEST_METHOD"] == "POST" fails, what does the page display?

a)

The form page again.

b)

A 404 error.

c)

A success message.

d)

"Invalid access."

86.

Where will the .txt files created by the PHP script (Lesson 6) be saved in XAMPP if the code does not specify a different path?

a)

In the folder C:\xampp\temp.

b)

In the folder C:\xampp\mysql.

c)

In the root of C:.

d)

In the same folder as the PHP file (dados.php in Lesson 6).

87.

What does the snippet $_POST["campo"] ?? "" do in the code (Lesson 6)?

a)

Sets the default value to 0.

b)

Forces the field to have a value.

c)

Ensures that if the field does not exist in $_POST, no error occurs (Null Coalescing Operator).

d)

Validates whether the field is a number.

88.

What is the role of the file form6.php in Lesson 6?

a)

Create the .txt file.

b)

Process the data.

c)

List the created files.

d)

Contain the HTML form for data collection.

89.

What needs to be done in the browser so that the form-processing page (such as dados.php in Lesson 6) can be tested correctly?

a)

Access it directly by URL.

b)

Restart XAMPP.

c)

Open the .txt file.

d)

Fill out the form in form6.php and click the Submit button.

90.

What does the function date("His") return?

a)

The full year.

b)

The current date (day, month, year).

c)

Hour, minute, and second.

d)

The name of the month.

91.

What is the primary purpose of a database connection in PHP, according to Lesson 7?

a)

To style web pages.

b)

To only read data from .txt files.

c)

To execute code on the client side.

d)

To let the PHP script communicate with the database to store, query, update, or delete data.

92.

Which PHP file connects to the database server (MySQL/MariaDB)?

a)

index.php

b)

validar.php

c)

dados.php

d)

conexao.php

93.

What is the name of the graphical tool (included in XAMPP) used to manage the database (create tables, insert records manually, etc.)?

a)

MySQL Workbench

b)

SQL Server

c)

HeidiSQL

d)

phpMyAdmin

94.

When creating the table usuarios in phpMyAdmin, which two properties are essential for the ID field (record identifier)?

a)

Type VARCHAR and NOT NULL

b)

Type FLOAT and Default 0

c)

Type TEXT and UNIQUE

d)

Primary Key (PRIMARY KEY) and Auto Increment (A_I or Auto Increment)

95.

In the registration flow, which page (PHP file) receives the form data and executes the SQL instruction INSERT INTO to save the information to the database?

a)

index.php

b)

conexao.php

c)

dados.php

d)

validar.php

96.

Which SQL instruction is used on the page validar.php (Lesson 7) to add a new record to the table usuarios?

a)

UPDATE

b)

SELECT

c)

DELETE

d)

INSERT INTO

97.

In which file is the PHP function mysqli_connect() used?

a)

validar.php

b)

index.php

c)

dados.php

d)

conexao.php

98.

If the database is named cadastros and the server is on your local machine, what is the host name used in the connection?

a)

192.168.1.1

b)

db_server

c)

localhost/cadastros

d)

localhost (or 127.0.0.1)

99.

Which of the following fields was not used in the table usuarios created in Lesson 7?

a)

ID

b)

usuario

c)

senha

d)

cpf

100.

After registration in validar.php, which message is displayed to the user indicating the operation was successful?

a)

"Server error!"

b)

"Invalid access!"

c)

"Registration completed successfully!"

d)

"Back"

101.

What happens to the ID of a new record in the table usuarios thanks to the Auto Increment (A_I) property?

a)

The user must type it in the form

b)

It will always be 1

c)

It is generated automatically by the database, increasing with each new record

d)

It is an optional field that may be left empty

102.

What does the command mysqli_query() do in the context of validar.php?

a)

Receives the form data

b)

Opens the connection to the database

c)

Closes the connection to the database

d)

Executes the SQL instruction (INSERT INTO...) in the database

103.

Which term is used for the process that allows the PHP script to send SQL commands and receive results?

a)

Authentication

b)

Loop structure

c)

Conditional structure

d)

Communication channel / Connection to the Database

104.

Which DBMS (Database Management System) used in the lessons is part of XAMPP?

a)

PostgreSQL

b)

Oracle

c)

SQL Server

d)

MySQL/MariaDB

105.

Why is it important to include the file conexao.php at the beginning of validar.php?

a)

To set the page style

b)

So the form variables are read

c)

So the database connection is active before attempting to execute INSERT INTO

d)

To include the HTML menu

106.

What does the acronym CRUD represent in system development?

a)

Clean, Read, Update, Deploy

b)

Connect, Run, Upload, Download

c)

Client, Router, User, Data

d)

Create, Read, Update, Delete

107.

Which SQL instruction is used on the page dados.php to select and list all registered users?

a)

UPDATE

b)

DELETE

c)

INSERT INTO

d)

SELECT * FROM usuarios

108.

Which PHP function is used on the page dados.php (inside a while loop) to iterate over and return each row from the SQL query result as an associative array?

a)

mysqli_connect()

b)

mysqli_query()

c)

mysqli_num_rows()

d)

mysqli_fetch_assoc()

109.

The function mysqli_num_rows() is used to:

a)

Close the connection to the database.

b)

Execute the SQL query.

c)

Return the current row from the result.

d)

Verify that more than zero rows (records) were returned by the query.

110.

Why does the page dados.php use a while loop?

a)

To define the CSS style.

b)

To insert new data.

c)

To close the connection.

d)

To iterate over the query result set and display each record in the table.

111.

If the SQL query returns no records, what does the else block on dados.php display?

a)

A connection error.

b)

An empty table.

c)

A syntax error.

d)

"No user registered."

112.

How are the data for each field (e.g., usuario) displayed in the HTML table within the while loop?

a)

Using $_POST["usuario"].

b)

Using echo $usuario.

c)

Using mysqli_query("SELECT usuario").

d)

Using echo linha[′usuario′](wherelinha['usuario'] (where linha is the associative array).

113.

Which PHP file must be included in dados.php before performing the database query?

a)

index.php

b)

validar.php

c)

conexao.php

d)

style.css

114.

In the HTML of the page dados.php, the

structure is used to:

a)

Create a registration form.

b)

Connect to the database.

c)

Set the page font.

d)

Present user data in a tabular format (rows and columns).

115.

Which HTML element is used to define the column header in the users table?

a)

b)

c)

d)

116.

What does the command resultado=mysqliquery(resultado = mysqli_query( conexao, $sql); do?

a)

Starts the server.

b)

Defines the connection.

c)

Stores the SQL instruction in the variable $sql.

d)

Executes the SQL query and stores the result in $resultado.

117.

The variable $linha (returned by mysqli_fetch_assoc()) contains record data in which format?

a)

A single string with all data.

b)

A PHP object.

c)

Only the user ID.

d)

An associative array (where the key is the column name, e.g., usuario).

118.

What does the code display in the table on the page dados.php?

a)

The name of the field "id".

b)

The static text "id".

c)

The unique identification number of each user.

d)

The name of the table.

119.

The final objective of Classes 7, 8, and 9 is to have a complete system that allows you to:

a)

Only register data.

b)

Only display the home page.

c)

Only read data from files.

d)

Perform the four CRUD operations (Create, Read, Update, Delete).

120.

Which CRUD operation does the page excluir.php (Lesson 9) implement?

a)

Create

b)

Read

c)

Update

d)

Delete

121.

What SQL statement does the page excluir.php use to remove a record from the database?

a)

SELECT * FROM usuarios WHERE ID = X

b)

UPDATE usuarios SET ... WHERE ID = X

c)

INSERT INTO usuarios VALUES ...

d)

DELETE FROM usuarios WHERE ID = X

122.

How do the pages editar.php and excluir.php identify the specific user record that must be modified or removed?

a)

By the user's full name

b)

By the user's email

c)

By the password

d)

By the record's ID field

123.

On the page editar.php, the form field is prefilled with the user’s current data for editing. Which HTML attribute, together with PHP echo, is used to display the field’s current value?

a)

placeholder

b)

name

c)

id

d)

value

124.

Before displaying the edit form on editar.php, which SQL operation is performed first?

a)

UPDATE to clear the fields

b)

INSERT to duplicate the record

c)

DELETE to remove the old record

d)

SELECT * FROM usuarios WHERE ID = X to fetch the user’s current data

125.

In which part of the page editar.php is the SQL statement to update a record (UPDATE) executed?

a)

When the page first loads

b)

When the page is deleted

c)

After the user fills the form and clicks the Update button (sent via POST)

d)

Only when closing the connection

126.

Which SQL instruction is used to modify the data of an existing record (Update)?

a)

CREATE TABLE

b)

SELECT

c)

INSERT INTO

d)

UPDATE usuarios SET campo='novo_valor' WHERE ID=x

127.

Which submission method (GET or POST) is most likely used on the page dados.php to send the user ID to excluir.php or editar.php via a link?

a)

POST

b)

SESSION

c)

COOKIE

d)

GET (e.g., excluir.php?id=10)

128.

What happens to a user record when they click the Delete link and the action is processed by excluir.php?

a)

The record is marked as inactive

b)

The user is redirected to the home page

c)

The user’s data is sent to a .txt file

d)

The user’s record is permanently removed from the database

129.

After the form is submitted, what does the editar.php page receive from the $_POST superglobal array?

a)

Only the user ID

b)

Only the password

c)

The new values for username, email, and password

d)

The SQL SELECT command

130.

What does Lesson 9 highlight as the final result of all the learning?

a)

Knowing only basic PHP syntax

b)

Creating only static forms

c)

Handling only text files

d)

Having a site with a database and the features to Create, Edit, and Delete (CRUD)

131.

What is the role of the Cancel button on the page editar.php?

a)

Delete the record from the database

b)

Confirm deletion

c)

Redirect back to dados.php without making changes

d)

Submit the form data

132.

Which PHP function is used in excluir.php to execute the DELETE FROM ... statement on the database?

a)

mysqli_fetch_assoc()

b)

mysqli_connect()

c)

mysqli_close()

d)

mysqli_query()

133.

What should be included in the code of editar.php and excluir.php to ensure the operation can be performed?

a)

style.css

b)

index.php

c)

validar.php

d)

conexao.php