Lecture 6 - ServerSideScripting I Flashcards Preview

Web-Centric > Lecture 6 - ServerSideScripting I > Flashcards

Flashcards in Lecture 6 - ServerSideScripting I Deck (30)
Loading flashcards...
1

What does PHP stand for?

PHP: HyperText Preprocessor

2

The web server does what three things with php?

Interprets, processes and renders

3

What interprets, processes and renders php?

a web server

4

What language can handle complex data processing that allows for dynamic content?

php

5

Can PHP handle both new and permanently stored data?

Yes!

6

What does LAMP stand for?

Linux, Apache, MySQL, PHP

7

can the closing tag... ?>... be omitted on occasions?

Yes. Sometimes it is purposefully omitted.

8

What is the difference between echo and print?

They are mostly the same aside from the fact that echo has no return value and print returns a value of 1. Echo can take multiple parameters, but print can only take one.

9

What are three ways to comment in PHP?

//this is a comment
/*This is a comment*/
#This is a comment

10

What does a php script consist of?

a series of commands and statements

11

What is each statement terminated with

A semicolon (;)

12

What do php statements do?

Call for functions and provide parameters

13

Can a function have more than one parameter?

yes! Each parameter is separated by a comma.

14

Name two built-in php functions

The include function and the require function

15

What is the difference between failure of an include file and a required file?

Include: In case of failure, a warning will be generated.

Require: In case of failure, the execution of the script will be terminated.

16

Php scripts are executed on the server, but can we see php code when we "View Source" in our browser?

No! Only html is visible

17

Use PHP to echo a date

echo date('I, F ds Y.');

18

Is PHP a loosely typed language?

Yes! Good job!

19

What can we do to variables in php?

They can be altered, printed to the browser, saved to a database, emailed, etc.

20

What are variable names always preceded with?

$

21

Is this var name okay or illegal?

$3fifteen

No, the first char after $ must be a letter or underscore

22

How do you concatenate in php?

with a period: $example = 'Hi' . 'there';

23

What is variable interpolation?

The process of converting a variable name into their actual value. Use "" instead of ''.

"" prints value
'' prints var name

24

What does an array look like in PHP?

$myArray = array('item1'=>'my value', 'item 2'=>'another value');

25

What is an indexed array?

These use numbers as indices to point to the values they contain.

26

What is an associative array?

The array’s values are associated with meaningful indices

27

How do you print the contents of an array in php?

print_r()

28

What is $_REQUEST used for?

Used when requesting a variable regardless of it being sent as part of the
query string (i.e., $_GET) or a form post (i.e., $_POST)

29

What are objects used for?

Storing instances of classes

30

When is a Task Flow useful?

When dealing with forms, it is recommended to use one.