lab 9 · 2019-11-03 · case-sensitive only first statement will display value because the other...

24
Lab 9 By James Sager – Oct 15, 2017 CS486T

Upload: others

Post on 12-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 2: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Forms

Functions

ECHO and PRINT

PHP Syntax

Outlines

01

02Php Variables

03

04

05

Page 3: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

PHP Syntax

Page 4: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

PHP Syntax

Page 5: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Case-sensitive

Note: However; all variable names are case-sensitive!

Page 6: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Case-sensitive

Only first statement will display value because the other statements are treated as three different variables.

Page 8: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Variables

In PHP, a variable starts with the $ sign.

Page 9: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Echo statement

Page 10: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Print statement

Page 17: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Function

Note: A function name must start with a letter or an underscore. Function names

are NOT case-sensitive.

Page 22: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Evaluation

<!DOCTYPE html>

Page 23: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

Complete the following:

Notice:• that at the start of the script, we check whether the form has been submitted using

$_SERVER["REQUEST_METHOD"]. • If the REQUEST_METHOD is POST, then the form has been submitted - and it should be

validated. • If it has not been submitted, skip the validation and display a blank form.

• All input fields are optional.

Page 24: Lab 9 · 2019-11-03 · Case-sensitive Only first statement will display value because the other statements are treated as three different variables

What to do at home

Try to use “upload” in this source:

https://www.w3schools.com/php/php_file_upload.asp