Chapter 6: PHP

Descrição

Sanchez, L. (2017). Web Programming with HTML, CSS, Bootstrap, JavaScript, JQuery, PHP, and MySQL . CreateSpace Independent Publishing Platform.
Rebecca Walton
Quiz por Rebecca Walton, atualizado more than 1 year ago
Rebecca Walton
Criado por Rebecca Walton quase 5 anos atrás
37
0

Resumo de Recurso

Questão 1

Questão
All PHP statements should be surrounded by which delimiters?
Responda
  • <php> and </php>
  • <script> and ></script>
  • <script><php> and </php></script>
  • <?php and ?>

Questão 2

Questão
A PHP statement is terminated with which symbol?
Responda
  • <end>
  • .
  • ;
  • ?

Questão 3

Questão
All variables in PHP start with which symbol?
Responda
  • ?
  • .
  • var
  • $

Questão 4

Questão
In PHP, $content = "<p>Hello World</p>". Write a PHP statement that displays the content on the browser screen.
Responda
  • display($content);
  • echo$content;
  • echo "Hello World";
  • echo content;

Questão 5

Questão
In PHP, you can use either single quotes ('This is a string') or double quote ("This is a string") for strings.
Responda
  • true
  • false

Questão 6

Questão
In PHP, which of the following is the correct way to comment a single line?
Responda
  • <!--This is a line of comment-->
  • <comment>This is a line of comment</comment>
  • <?php This is a line comment?>
  • //This is a line of comment

Questão 7

Questão
In PHP, which of the following is NOT a correct variable name?
Responda
  • $3val
  • $val3
  • $val_3
  • $val_of_3

Questão 8

Questão
In PHP, how do you add 1 to a variable called $i?
Responda
  • i++
  • i=+1;
  • ++$i;
  • ++i;

Questão 9

Questão
How does PHP receive the information from an HTML form that is submitted using he "post" method? Suppose in HTML there's a text box <input type="text"name="userinput">
Responda
  • $_POST["userInput"];
  • $_GET["userInput"];
  • $_USERINPUT();
  • $_GET(userInput);

Questão 10

Questão
When using the get method to submit an HTML form to a PHP file, the variables are displayed in the URL
Responda
  • true
  • false

Questão 11

Questão
Which of the following is a correct way to create and array in PHP?
Responda
  • $grades = array (78, 87, 95, 53);
  • $grades = (56, 78, 89, 90);
  • $grades = array ([56], [67], [78], [89]);
  • $grades = {56, 67, 78, 89};

Questão 12

Questão
Write a PHP statement to include a file called "footer.inc"
Responda
  • <!--include file = "footer.inc"-->
  • <?php include file = "footer.inc";?>
  • <?php include "footer.inc";?>
  • <?php include: "footer.inc;?>

Questão 13

Questão
In PHP, how do you retrieve the content from a file called feedback.txt and store the content in an array call $fileContent?
Responda
  • $fileContent = "feedback.txt";
  • $fileContent = php_read("feedback.txt");
  • $fileContent = file("feedback.txt");
  • $fileContent = file_read("feedback.txt");

Questão 14

Questão
In PHP file upload in regards to security, which of the following is a true statement?
Responda
  • Do not allow file uploads
  • It is safe as long as you don't allow .exe file upload
  • It is safe as long as the file size is small
  • It is safe as long as only an account holder can upload a file

Questão 15

Questão
In PHP what will $i+=2 do?
Responda
  • a typo
  • the value in the variable $i is increased by 2
  • the vriable $i now equals to 2
  • the value in the variable i is increased by 2

Questão 16

Questão
In PHP a session is used so that the server can remember the browser
Responda
  • true
  • false

Semelhante

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr