Slide 1

Slide 1 text

Start to Build your Web Fundamental PHP & Web Development lecturer : Lucien Lee 李柏緯 Lecture 1

Slide 2

Slide 2 text

2 李柏緯 Lucien Lee [email protected] lucien.leee Actually , I’m front-end developer! In Mobile Human Computer Interaction Lab

Slide 3

Slide 3 text

Before Start... 3

Slide 4

Slide 4 text

What do you want in this class? 4

Slide 5

Slide 5 text

I hope... 5

Slide 6

Slide 6 text

You can prototype 6 make your idea realize

Slide 7

Slide 7 text

Those website made by PHP still use PHP now 7

Slide 8

Slide 8 text

8

Slide 9

Slide 9 text

9

Slide 10

Slide 10 text

10

Slide 11

Slide 11 text

11

Slide 12

Slide 12 text

12 Although you can’t make a website as good as them after this class, it is the beginning.

Slide 13

Slide 13 text

You need more practice! 13

Slide 14

Slide 14 text

! We’ll have homework 14

Slide 15

Slide 15 text

LET’S START! 15

Slide 16

Slide 16 text

? How web work 16

Slide 17

Slide 17 text

STATIC CASE 17 EVERYONE SEE The Same Content

Slide 18

Slide 18 text

How web works? 18 Client Server

Slide 19

Slide 19 text

How web works? 18 Client Server

Slide 20

Slide 20 text

How web works? 18 Client Server Request

Slide 21

Slide 21 text

How web works? 18 Client Server Request http://www.google.com

Slide 22

Slide 22 text

How web works? 18 Client Server Request http://www.google.com Response

Slide 23

Slide 23 text

How web works? 18 Client Server Request http://www.google.com Response HTML

Slide 24

Slide 24 text

DYNAMIC CASE 19 Content are Decided by InPUT.

Slide 25

Slide 25 text

How web works? 20 Client Server Request http://www.google.com Response HTML

Slide 26

Slide 26 text

How web works? 20 Client Server Request http://www.google.com Response HTML PHP JavaScript

Slide 27

Slide 27 text

SET ENVIRONMENT 21

Slide 28

Slide 28 text

22 PHP Apache MYSQL

Slide 29

Slide 29 text

23 PHP •PHP:Hypertext Preprocessor •Can be embedded into HTML •Like C & Perl •Efficient •FREE!

Slide 30

Slide 30 text

Apache •Apache HTTP Server •Cross platform •PHP run on Apache •FREE! 24

Slide 31

Slide 31 text

MySQL •Database management system •Cross platform •EASY •FREE! for personal use 25

Slide 32

Slide 32 text

26 Linus Mac Windows LAMP MAMP WAMP

Slide 33

Slide 33 text

All-in-One 27 YoU Don’t have install by yourself

Slide 34

Slide 34 text

Package •WampServer •AppServ •XAMPP •MAMP •...... 28

Slide 35

Slide 35 text

The easiest one is 29

Slide 36

Slide 36 text

Test localhost 30 http://localhost/ or Http://127.0.0.1/

Slide 37

Slide 37 text

OK, Let’s GO! 31

Slide 38

Slide 38 text

Hello World! 32

Slide 39

Slide 39 text

33 hello.php

Slide 40

Slide 40 text

Semicolon echo 'hello world'; 34

Slide 41

Slide 41 text

Comment //This line wouldn’t execute. #For programmer note something. /*multiple lines comment multiple lines comment multiple lines comment*/ 35

Slide 42

Slide 42 text

Variable • Program use variable to save value. • Like a Box with name, you can put anything in the box. 36 Price 100 $Price = 100

Slide 43

Slide 43 text

Type •integer •float, double •boolean •string •null •array •object 37

Slide 44

Slide 44 text

Weak typed you don’t need to clam type for variable 38

Slide 45

Slide 45 text

Operator •+、-、*、/ •++、-- •==、!=、>、<、<=、>=、!== •. (string connecting) 39

Slide 46

Slide 46 text

Constant • It doesn’t change value after assign. • define(name, value) • Ex:define(‘PI’, 3.14); 40

Slide 47

Slide 47 text

ARRAY •a collection of data items. •key map to value. •Like many box put together. 41 Apple 100 Orange 150 Banana 200

Slide 48

Slide 48 text

Sample $Price[0] = 100; $Fruit = array(“apple”,”orange”, “banana”); //$Fruit[0] = “apple” list( $fruit1, $fruit2 ) = $Fruit; echo $fruit1;//Get “apple” echo $fruit2;//Get “orange” 42

Slide 49

Slide 49 text

Sample $Price = array(“apple”=>100, ”orange”=>150, “banana”=>200); //$Price[“orange”] = 150; 43

Slide 50

Slide 50 text

Live Coding 44

Slide 51

Slide 51 text

homework 45 •Setup PHP + MySQL + Apache in your computer •Try http://localhost and http://localhost/phpmyadmin •Screenshot those two site and send to me. •[PHP class] hw1-

Slide 52

Slide 52 text

AppServ 46

Slide 53

Slide 53 text

47 Wamp

Slide 54

Slide 54 text

MAMP 48

Slide 55

Slide 55 text

XAMPP 49 http://it-easy.tw/xampp/

Slide 56

Slide 56 text

PHPMYADMIN 50