Lecture 6 - ServerSideScripting I Flashcards

1
Q

What does PHP stand for?

A

PHP: HyperText Preprocessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The web server does what three things with php?

A

Interprets, processes and renders

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What interprets, processes and renders php?

A

a web server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

php

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can PHP handle both new and permanently stored data?

A

Yes!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does LAMP stand for?

A

Linux, Apache, MySQL, PHP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

Yes. Sometimes it is purposefully omitted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between echo and print?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are three ways to comment in PHP?

A
//this is a comment
/*This is a comment*/
#This is a comment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a php script consist of?

A

a series of commands and statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is each statement terminated with

A

A semicolon (;)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do php statements do?

A

Call for functions and provide parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can a function have more than one parameter?

A

yes! Each parameter is separated by a comma.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Name two built-in php functions

A

The include function and the require function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

No! Only html is visible

17
Q

Use PHP to echo a date

A

echo date(‘I, F ds Y.’);

18
Q

Is PHP a loosely typed language?

A

Yes! Good job!

19
Q

What can we do to variables in php?

A

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

20
Q

What are variable names always preceded with?

21
Q

Is this var name okay or illegal?

$3fifteen

A

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

22
Q

How do you concatenate in php?

A

with a period: $example = ‘Hi’ . ‘there’;

23
Q

What is variable interpolation?

A

The process of converting a variable name into their actual value. Use “” instead of ‘’.

”” prints value
‘’ prints var name

24
Q

What does an array look like in PHP?

A

$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.