CH7 Introduction to PHP Flashcards

1
Q

Scripting

A

a type of coding which requires writing step-by-step functions or processes

these are run automatically

increases the functionality of a programming language

e.g. C, C++, Java and Python

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

Web Apps

A

–apps that run on the web
–they are slowly gaining immense popularity
–these apps help to centralise and organise work effectively
–they do not require the user to download any application, this saves data
– written with a scripting language and then interpreted by the web server

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

PHP

A

Hypertext Preprocessor: widely used for creating web applications

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

Advantages of using PHP

A
  1. EASY TO LEARN: It shows similarities with C and C++ and it is commonly used.
  2. ADABTABILITY: Code written in PHP can be run on any operating system
  3. FREE AND EASILY AVAILABLE
  4. EXTENSIVE DATABASE SUPPORT: can use database services of different database applications
  5. SECURE: the safety features of web server is applicable to the app developed in PHP
  6. Does not require any memory-consumption for installation, use any text editor app
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Basic Syntax of PHP

A
  1. starts with <?php and ends with ?>
  2. It is saved with the extension .php
  3. includes both HTML tag and some PHP code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

echo statement

A

used to print the outcome on the screen
it can be used with or without a parenthesis
e.g. echo “Hello”;
echo (“Hello”);

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

keywords

A

reserved words that are language specific
each language has a different set of keywords that are understood by the compiler or the interpreter
e.g. and, break, for, if

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

Identifiers

A

–name the different components of a program
–like variables, methods and objects in a code
– they give names to abstract parts of a program

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

Naming Convention for Identifiers

A

–can only start with a letter or an underscore. A variable starts with a $.
–can be of any length
– mixture of letters, numbers, underscore and ASCII characters
–can be both uppercase and lowercase (case-sensitive)
–cannot use keywords
– no space is allowed

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

Literals

A

sequence of character that represent values which are stored as variables
it can be digits, letters or other characters
e.g. $v=20
here the literal is 20 which represents the value stored in $v.

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

Variables

A
  1. a character that can be assumed to have different values
  2. it is stored in the memory of the computer and can be used again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Naming Convention for PHP variables

A
  1. must start with a $
  2. can be of any length
  3. must not contain space
  4. both uppercase and lowercase letter can be used to name a variable
  5. case-sensitive
  6. made up of letters, digits and underscore
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Operators

A

symbols that are used to perform arithmetic or logical operations in a given expression
1. Arithmetic
2.Comparison
3. Logical

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

Expression

A

a combination of variables, literals and other values

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

Operands

A

the variable or literal on which the arithmetic operation is being applies

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

Arithmetic Operators

A

basic mathematical operations, like addition, subtraction and modulus (%), are applied on operands

the operand can be a constant or a variable

17
Q

Comparison Operators

A

–used to compare the values of 2 or more operands
–return a Boolean value after an expression is evaluated
–e.g. ==,!=,>,<

18
Q

Logical Operators

A

–also called Boolean operators, they compare 2 comparison statements to form a conditional
–return in a Boolean value
–And (&&), OR (II), Not (!=)

19
Q

Components of the Notepad++ window

A

TITLE BAR: shows the name of the current window which is opened and also the saved file

MENU BAR: showcases various option that are used to perform different activities like editing, debugging etc.

TOOL BAR: contains tools or commands that are frequently used.

CODE EDITOR WINDOW: the window which is used to write and edit the code

STATUS BAR: displays the status of the number of lines, columns, words etc.

FILE TAB: Notepad allows the user to simultaneously work on different files at the same time. They display different tabs for each file.

20
Q

websites

A

Static Websites: do not share data between web pages and it remains unchanged

Dynamic Websites: share data among multiple web pages of the website
–more common nowadays

21
Q

Differences between the GET and POST methods

A

–used by a website to share the user’s data among its web pages
–used inside the <form> tag to send the form data to the server

GET Method: uses the predefined $_GET variable for processing
»data is visible to everyone in the address bar
»not used to share sensitive information

POST Methods: uses the predefined global variable $_POST
»the data remains invisible to anyone