Introduction to PHP part3 - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to PHP part3

Description:

Introduction to PHP part3 ... – PowerPoint PPT presentation

Number of Views:219
Avg rating:3.0/5.0
Slides: 35
Provided by: ujr
Category:

less

Transcript and Presenter's Notes

Title: Introduction to PHP part3


1
Introduction to PHP part3
2
Outline
3
????
  • ??????????????????????, ??????????
  • Ex Google????
  • ????????????????????????
  • ??HTML??????????
  • ??(Form)
  • Web server????????????????????????, ????????

4
PHP?????
  • ?????????????,?????????????????????PHP??????,?????
    PHP????????

?????????????PHP?????
User input data
??????????????
PHP??
5
??(Form)
  • ????????, ??????????????
  • ????(Text), ????(Password), ?????(Radio),
    ?????(Check Box), ???????????(Text Area)
  • ???????????????????web server
  • ?????????????????????

6
??(Form)
  • ????????GET?POST
  • GET?????255 ,?????????????1?????2??http//ip/
    get.php?a1b2
  • POST????????,????????(????php????????)

???????php
php???ip
??????server?, ???php?????????
?????GET?POST??????
7
PHP?? (GET Method)
  • ?????????
  • ?server????person.html, ????????

ltform method"get" action"get.php"
name"myform"gt ?? ltinput name"name"gtltbrgt ???????
nbspltinput name"check" type"checkbox"gt ??nbsp
ltselect name"year"gt ltoption
value"first"gt??lt/optiongt ltoption
value"second"gt??lt/optiongt ltoption
value"third"gt??lt/optiongt ltoption
value"fourth"gt??lt/optiongt lt/selectgt ? ltinput
name"sex" value"boy" type"radio"gt ? ltinput
name"sex" value"girl" type"radio"gtltbrgt ltinput
name"submit" value"submit" type"submit"gtltbrgt lt/
formgt
??????????GET, ?????server?, server??????get.php,
??, ????????get.php?? (?????person.html?get.php???
?????)
???html???
8
??GET????, ???????????????????
??submit?, ???????server
???????get.php?????????????
9
get.php????
lt?php name_GET'name' sex_GET'sex'
check_GET'check' year_GET'year' ech
o name echo "???sexltbrgt" if
(strcmp("on",check)0) echo "???? year
year" else echo "??????" ?gt
??_GET?????????????
  • ????
  • ?????form????name??????????
  • echo???????client
  • strcmp???????????????function, ?????0

10
PHP?? (POST Method)
  • ?????
  • ?server????message.html, ????????

message.html????
ltform method"post" action"message.php"
name"form"gt ???? ???? ltinput name"name"gtltbrgt ??lt
brgt lttextarea cols"30" rows"5"
name"message"gtlt/textareagtltbrgt lt/formgt
11
  • ????
  • ??POST method??????????????
  • ??????nameJohn
  • messageHello

12
message.php????
lt?php nickname_POST'name' message_POST
'message' timedate("Y-m-d His") echo
"lttable border\"1\"" echo "cellpadding\"2\"
cellspacing\"2\"gt lttbodygt lttrgt" echo
"lttd gt nickname lt/tdgt" echo "lttd gt time
lt/tdgtlt/trgtlttrgt" echo "lttd colspan\"2\"
rowspan\"1\"gt" echo "message
lt/tdgtlt/trgtlt/tbodygtlt/tablegt" ?gt
  • ????
  • ??_POST?????POST???????
  • date(Y-m-d His)????????????
  • ?????????, echo ????HTML??

13
Outline
14
?????
  • ?????????????
  • ???????????????
  • ?????????????
  • ???????????????
  • ???????????
  • ???????????????, ????????????, ????????????
  • ?????????????????

15
??????????????
?????
????, ??, ??
???????
???
???????
16
??????
  • ??????????????
  • ?????????????, ????????, ?????????????
  • ?????????????, ??????

?????
?????
?? ?? ?? ?? ??
1 ?? ??????? 02-2222
2 ?? ?????? 04-1111
3 ?? ?????? 03-5555
?? ?? ?? ?? ?? ????
1 11/23 3 ?
2 11/24 1 ?
17
??????
  • ????????????, ?????????, ??DDL
  • ????????

18
?????????? (cont)
  • ????(primary key)????(foreigner key)???????????
  • ??(primary key) ????????????????, ??????????
  • ????????????
  • ????????, ?????????
  • ????????????,???????????

?? ?? ?? ?? ??
1 ?? ??????? 02-2222
2 ?? ?????? 04-1111
3 ?? ?????? 03-5555
??
19
??????????
  • ???(foreigner key) ?????????????????????
  • ??????????????

?????
?????
?? ?? ?? ?? ??
1 ?? ??????? 02-2222
2 ?? ?????? 04-1111
3 ?? ?????? 03-5555
?? ?? ?? ?? ?? ????
1 11/23 3 ?
2 11/24 1 ?
????????
???, ???????????
????????
20
MySQL
  • PHP??????????????, ??PHPMySQL???????
  • MySQL?????????????, ?????????
  • phpMyAdmin????php3??,??MySQL??????Web?????????????
    ?????,??MySQL?????????????,??????????????

21
??phpMyAdmin?????
  • http//ip/home/mysql
  • IP?MySQL server?ip address, ????????????, ???PHP
    server?IP??

22
?????????
???????root, ????, ?????????root???
??????????????
23
????????????
  • ?????, ?????phpMyAdmin??????????, ?????
  • ??Program Files\EasyPHP5.3.0\phpmyadmin??config.in
    c.php
  • ?????cfg'Servers'i'password'

24
?????
???????????????
25
?????
?????
26
????????
???Primary key??????, ??????VarChar, ???????????
27
???????
28
?????????
?Designer??, ??????????
29
????
???????, ??????????????
?????
30
????(SQL)
?Access???????
?????????, ??????, ???SQL??
31
PHP?????
  • ????????????????(?????), ?????php????????????????
  • PHP?MySQL??????

????????????
???HTML??
32
?? ????
  • ?server????bookstore.html???, ??????????

??????php???
???Peh, ????????
33
?????
34
????
  • ????????????????10?
  • ??????????????? (???)
  • ????????, ???????????, ??????????, ???? (50
    bonus)
Write a Comment
User Comments (0)
About PowerShow.com