Rebecca Walton
Quiz von , erstellt am more than 1 year ago

Sanchez, L. (2017). Web Programming with HTML, CSS, Bootstrap, JavaScript, JQuery, PHP, and MySQL . CreateSpace Independent Publishing Platform.

21
0
0
Rebecca Walton
Erstellt von Rebecca Walton vor mehr als 4 Jahre
Schließen

Chapter 6: PHP

Frage 1 von 16

1

All PHP statements should be surrounded by which delimiters?

Wähle eine der folgenden:

  • <php> and </php>

  • <script> and ></script>

  • <script><php> and </php></script>

  • <?php and ?>

Erklärung

Frage 2 von 16

1

A PHP statement is terminated with which symbol?

Wähle eine der folgenden:

  • <end>

  • .

  • ;

  • ?

Erklärung

Frage 3 von 16

1

All variables in PHP start with which symbol?

Wähle eine der folgenden:

  • ?

  • .

  • var

  • $

Erklärung

Frage 4 von 16

1

In PHP, $content = "<p>Hello World</p>". Write a PHP statement that displays the content on the browser screen.

Wähle eine der folgenden:

  • display($content);

  • echo$content;

  • echo "Hello World";

  • echo content;

Erklärung

Frage 5 von 16

1

In PHP, you can use either single quotes ('This is a string') or double quote ("This is a string") for strings.

Wähle eine der folgenden:

  • true

  • false

Erklärung

Frage 6 von 16

1

In PHP, which of the following is the correct way to comment a single line?

Wähle eine der folgenden:

  • <!--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

Erklärung

Frage 7 von 16

1

In PHP, which of the following is NOT a correct variable name?

Wähle eine der folgenden:

  • $3val

  • $val3

  • $val_3

  • $val_of_3

Erklärung

Frage 8 von 16

1

In PHP, how do you add 1 to a variable called $i?

Wähle eine der folgenden:

  • i++

  • i=+1;

  • ++$i;

  • ++i;

Erklärung

Frage 9 von 16

1

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">

Wähle eine der folgenden:

  • $_POST["userInput"];

  • $_GET["userInput"];

  • $_USERINPUT();

  • $_GET(userInput);

Erklärung

Frage 10 von 16

1

When using the get method to submit an HTML form to a PHP file, the variables are displayed in the URL

Wähle eine der folgenden:

  • true

  • false

Erklärung

Frage 11 von 16

1

Which of the following is a correct way to create and array in PHP?

Wähle eine der folgenden:

  • $grades = array (78, 87, 95, 53);

  • $grades = (56, 78, 89, 90);

  • $grades = array ([56], [67], [78], [89]);

  • $grades = {56, 67, 78, 89};

Erklärung

Frage 12 von 16

1

Write a PHP statement to include a file called "footer.inc"

Wähle eine der folgenden:

  • <!--include file = "footer.inc"-->

  • <?php include file = "footer.inc";?>

  • <?php include "footer.inc";?>

  • <?php include: "footer.inc;?>

Erklärung

Frage 13 von 16

1

In PHP, how do you retrieve the content from a file called feedback.txt and store the content in an array call $fileContent?

Wähle eine der folgenden:

  • $fileContent = "feedback.txt";

  • $fileContent = php_read("feedback.txt");

  • $fileContent = file("feedback.txt");

  • $fileContent = file_read("feedback.txt");

Erklärung

Frage 14 von 16

1

In PHP file upload in regards to security, which of the following is a true statement?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 15 von 16

1

In PHP what will $i+=2 do?

Wähle eine der folgenden:

  • 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

Erklärung

Frage 16 von 16

1

In PHP a session is used so that the server can remember the browser

Wähle eine der folgenden:

  • true

  • false

Erklärung