SlideShare une entreprise Scribd logo
1  sur  105
PHP + HTML + MySQL + Smarty Speaker :張智宏
Profile ,[object Object],[object Object],[object Object],[object Object]
大綱 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
什麼是 PHP ,[object Object],[object Object],WWW server HTML  PHP DB server PHP  直譯器
PHP 歷史 ,[object Object],[object Object],[object Object]
PHP 歷史  ( 續 ) ,[object Object],[object Object]
PHP 特色 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP 特色 ( 續 ) ,[object Object],[object Object],[object Object],[object Object]
PHP  安裝 ,[object Object],[object Object]
Appserv  安裝 Figure 2  GNU/GPL License Agreement screen.   Figure 1  AppServ Welcome Screen
Appserv  安裝 Figure 3  Choose Install location screen.  Figure 4  Choose Package Components screen.
Appserv  安裝 Figure 5  Apache Web Server configure screen.  Figure 6  MySQL Database configure screen.
Appserv  安裝 Figure 7  Complete AppServ Setup screen.  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Appserv  安裝 http://localhost http://localhost/phpinfo.php   ( 需要事先建立 phpinfo.php , 稍後講述 )
Appserv  安裝 http://localhost/phpMyAdmin (  帳號: root    密碼: 安裝時設定的密碼  ) 如果以上三個網頁皆成功顯示出來,代表安裝成功。
PHP 程式起始標記 <? php ehco (“Hello World!!”);   // 單行註解 /* 這是 多行註解 */ ?> <? ehco (“Hello World!!”);   // 單行註解 /* 這是 多行註解 */ ?> <script language=“php”> ehco (“Hello World!!”);   // 單行註解 /* 這是 多行註解 */ </script>
PHP 變數 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP 變數 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP 變數 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP 資料型態 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Boolean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integer ,[object Object],[object Object],[object Object],[object Object],[object Object]
Float ,[object Object],[object Object],[object Object],[object Object]
String ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
String ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
NULL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Array ,[object Object],[object Object],Example 1 :學生成績 ,[object Object],Example 2 : 0 2 FF 1 B C A 100 Sue 1.2 Tim car May 200 0 1 6 5 4 3 2 80 90 86 83 87 92 88
Array ,[object Object],[object Object],[object Object],// 單純設值 // 使用 array()   $animals = array( &quot;cat&quot;, &quot;dog&quot;,   &quot;bird&quot; , &quot;turtle&quot; ); // 利用 index $animals[0] = &quot;cat&quot;; $animals[1] = &quot;dog&quot;; $animals[2] = &quot;bird&quot;; $animals[3] = &quot;turtle&quot;; // 指定 index // 使用 array()   $fruit = array (&quot;o&quot;=>&quot;orange&quot;,    &quot;b&quot;=>&quot;banana&quot; ,    &quot;a&quot;=>&quot;apple&quot; ); // 利用 index $fruit[&quot;o&quot;] = &quot;orange&quot;; $fruit[&quot;b&quot;] = &quot;banana&quot;; $fruit[&quot;a&quot;] = &quot;apple&quot;; Question : if we defined $array = array( 1, 1, 1, 1, 1, 8=>1, 4=>1, 19, 3=>13) , what indexs/values are in the $array?
Array ,[object Object],// 方法一 $team_member = array( &quot;team1&quot; => array( &quot;Tom&quot; , &quot;Bob&quot;) , &quot;team2&quot; => array( &quot;Sue&quot; , &quot;John&quot;) ,  &quot;team3&quot; => array( &quot;Ann&quot; , &quot;Joe&quot;)  ); // 方法二 $team_member[&quot;team1&quot;] = array (&quot;Tom&quot; , &quot;Bob&quot;);  $team_member[&quot;team2&quot;] = array (&quot;Sue&quot; , &quot;John&quot;); $team_member[&quot;team3&quot;] = array (&quot;Ann&quot; , &quot;Joe&quot;); // 方法三 $team_member[&quot;team1&quot;][0] = &quot;Tom&quot;;  $team_member[&quot;team1&quot;][1] = &quot;Bob&quot;; $team_member[&quot;team2&quot;][0] = &quot;Sue&quot;; $team_member[&quot;team2&quot;][1] = &quot;John&quot;; $team_member[&quot;team3&quot;][0] = &quot;Ann&quot;; $team_member[&quot;team3&quot;][1] = &quot;Joe&quot;;
Array ,[object Object],[object Object],[object Object],// 不指定 index $animals[] = &quot;fish&quot;;   $animals[] = &quot;lion&quot;; // 使用 array_push array_push ($animals , &quot;fish&quot; , &quot;lion&quot;); // 使用 unset() unset($animals[0]);  //$animals[0]  資料將被刪去,其他 index / value 不變。 sort ($animals);  //  依 Array 中的 value 對 Array 做排序,並修改 index 。 rsort ($animals);  //  依 Array 中的 value 對 Array 做倒序,並修改 index 。 count($animals);  //  計算變數中元素的數目
PHP 運算符號 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PHP 流程控制  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
If .. else ,[object Object],[object Object],$a =10;  $b = 9;  if ($a > $b) {    print &quot;a is bigger than b&quot;;  } else {    print &quot;a is NOT bigger than b&quot;;  } $a =10;  $b = 10;  if ($a > $b) {    print &quot;a is bigger than b&quot;;  } else {    print &quot;a is NOT bigger than b&quot;;  }
switch ,[object Object],[object Object],[object Object],[object Object]
switch ,[object Object],if ($i == 0) {  print &quot;i equals 0&quot;;  } if ($i == 1) { print &quot;i equals 1&quot;; } if ($i == 2) { print &quot;i equals 2&quot;;  }  switch ($i) { case 0: print &quot;i equals 0&quot;; case 1: print &quot;i equals 1&quot;; case 2: print &quot;i equals 2&quot;; } /*  switch structure with   break would more efficient */ switch ($i) { case 0: print &quot;i equals 0&quot;;   break; case 1: print &quot;i equals 1&quot;;   break; case 2: print &quot;i equals 2&quot;; } ,[object Object]
While ,[object Object],[object Object],$i = 1; while ($i <= 10) { print $i++;  /* the printed value would be $i before the increment (post-increment) */ } //12345678910  $i = 11; while ($i <= 10) { print $i++;  /* the printed value would be $i before the increment (post-increment) */ } //
do..while ,[object Object],[object Object],$i = 1; do{ print $i++;  } while ($i <= 10)  //12345678910  $i = 11; do{ print $i++;  } while ($i <= 10)  //11
While v.s. do  while ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
for ,[object Object],[object Object],[object Object],[object Object],for ($i = 1; $i <= 10; $i++) {  print $i;  }  //12345678910  for ($i = 1; $i <= 10; print $i, $i++); //12345678910  for ( ;  ;) {  print $i;  }  //1234… ( 無窮迴圈 )
foreach ,[object Object],[object Object],[object Object],[object Object]
foreach // 架構一 foreach ($animals as $value){   echo $value .  &quot;    &quot; ;  } /*  印出的結果   cat   dog   bird   turtle   */ // 架構二 foreach ($animals as $key => $value){   echo $key . &quot; - &quot;. $value . &quot;&quot;;  } /*  印出的結果   0 - cat   1 - dog   2 - bird   3 - turtle   */ //animal Array $animals = array ( &quot;cat&quot;  ,  &quot;dog&quot; ,   &quot;bird&quot; ,  &quot;turtle“ ); // 利用 while Wihle(list ($key , $value) = each($animals)) {   echo $key . &quot; – &quot;. $value . &quot;&quot;;   } /*  印出的結果   0 - cat   1 - dog   2 - bird   3 - turtle   */
foreach // 二維陣列 $team_member = array( &quot;team1&quot; => array( &quot;Tom&quot; , &quot;Bob&quot;) ,    &quot;team2&quot; => array( &quot;Sue&quot; , &quot;John &quot; ) ,  &quot;team3&quot; => array( &quot;Ann&quot; , &quot;Joe&quot;) ); foreach  ($team_member as $team_name  => $team){   echo $team_name .  &quot;  :  &quot;  ;   foreach ($team as $member){   echo $member .  &quot; : &quot;   ; } echo  &quot; : &quot;  ;  } /* 印出結果 team1 : Tom Bob team2 : Sue John  team3 : Ann Joe  */
break ,[object Object],[object Object],$i = 0; while (++$i) { switch ($i) { case 5: echo &quot;At 5<br>&quot;; break 1;  //  只離開  switch  case 10: echo &quot;At 10; quitting<br>&quot;; break 2;  //  離開  switch  和  while  default: break; } } $num_array = array ('one', 'two',  'three '  , 'four' , 'stop', 'five'); foreach  ($num_array as $value) { if ($value == &quot;stop&quot;) { break;  } echo $value  .&quot;&quot;; } /* 印出結果 one two three four */
continue $i = 0; while ($i++ <= 4) { $j = 0; while ($j <= $i) { $j++; if (!($j % 2)){ continue; } echo $j . &quot; &quot;; } echo &quot;&quot;; } /*  印出結果 1  1 3  1 3  1 3 5  1 3 5  */ $num_array = array (1 , 2 , 3 ,   4 , 5 , 6 ); foreach  ($num_array as $value){ if ( !($value % 2) ) { continue;  } echo $value .&quot;&quot;; } /* 印出結果 2 4 6 */ ,[object Object],[object Object]
引用文件 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
自定義函式 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],$Str = &quot;String is unchanged!&quot;; modify_the_value ($Str); function modify_the_value (&$para){ $para = &quot;String is chagned!&quot;; }
其他 ,[object Object],[object Object],$file = fopen (&quot;test.txt&quot;, &quot;r&quot;);  // 本地檔案 $file = fopen ( &quot; http://www.php.net/ &quot; ,  &quot;r&quot;);  // 遠端的文件 $file = fopen (&quot;ftp://example/test.txt&quot;, &quot;r&quot;);  // 遠端的文件 <form enctype=&quot;multipart/form-data&quot; action=&quot;_URL_&quot; method=&quot;post&quot;>   <input type=&quot;hidden&quot; name=&quot;MAX_FILE_SIZE&quot; value=&quot;1000&quot;>   Send this file: <input name=&quot;userfile&quot; type=&quot;file&quot;>   <input type=&quot;submit&quot; value=&quot;Send File&quot;> </form> <?php    copy($_FILES['userfile']['tmp_name'], &quot;/place/to/put/uploaded/file&quot;); /* ...or... */ move_uploaded_file($_FILES['userfile']['tmp_name'], &quot;/place/to/put/uploaded/file&quot;); ?>
其他 ,[object Object],[object Object]
[object Object]
HTML 概念 ,[object Object],[object Object],[object Object],[object Object]
HTML 概念 ,[object Object],[object Object],[object Object],<HTML> <HEAD> <TITLE> 網頁的標題 </TITLE> </HEAD> <BODY> 網頁的內容 </BODY> </HTML>
基本標籤說明 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常用標籤 :  文字相關 (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常用標籤 :  文字相關 (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常用標籤 :  文字相關 (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常用標籤 :  文字相關 (4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常用標籤 :  文字相關 (5) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
超連結標籤 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
表格製作 1 ,[object Object],[object Object],[object Object],[object Object]
表格製作 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
表格製作 3 ,[object Object],[object Object],[object Object],[object Object],<table border=&quot;3&quot;> <tr> <td>A</td>  <td rowspan=&quot;2&quot;> 上下兩格合成一格 </td> <td>B</td> </tr>  <tr> <td>C</td> <td>D</td> </tr> <tr> <td colspan=&quot;3&quot;> 左右三格合成一格 </td> </tr> </table>
常用符號 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Form ,[object Object],[object Object],[object Object],[object Object]
Form ,[object Object],<FORM name= &quot;test.php“  action=&quot;test.php&quot; method=&quot;post&quot;> 名字: <INPUT type=text value=&quot;test&quot;> <br> 密碼: <INPUT type=password> <br> 性別: <INPUT name=&quot;s&quot; type=radio value=&quot; 男 &quot;> 男 <INPUT name=&quot;s&quot; type=radio value=&quot; 女 &quot; checked> 女  <br> <INPUT type=&quot;submit&quot; value=&quot; 送出 &quot;> <INPUT type=&quot;reset&quot; value=&quot; 重新輸入 &quot;> </FORM>
Text & Password ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Radio & Checkbox ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Select ,[object Object],[object Object],[object Object],[object Object],[object Object]
Textarea & hidden ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Submit & Reset ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
<html> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=big5&quot;> <title> 網頁標題 </title> </head> <body> <form name=&quot;form1&quot; action=&quot;GetForm.php&quot; method=&quot;POST&quot;> <table border=&quot;1&quot; width=&quot;250&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;> <tr> <td align=&quot;right&quot;> 姓名: </td> <td><input type=&quot;text&quot; name=&quot;UserName&quot; value=&quot;&quot; size=&quot;8&quot;></td> </tr> <tr> <td align=&quot;right&quot;> 密碼: </td> <td><input type=&quot;password&quot; name=&quot;passwd&quot; value=&quot;&quot; size=&quot;8&quot; ></td> </tr>  <tr> <td align=&quot;right&quot;> 性別: </td> <td><input type=&quot;radio&quot; name=&quot;Gender&quot; value=&quot; 男 &quot;> 男 <input type=&quot;radio&quot; name=&quot;Gender&quot; value=&quot; 女 &quot;> 女 </td> </tr>  <tr> <td colspan=&quot;2&quot; align=&quot;center&quot;>   <input type=&quot;submit&quot; name=&quot;sendit&quot; value=&quot; 送出表單 &quot; > &nbsp;&nbsp; <input type=&quot;reset&quot; name=&quot;clear_form&quot; value=&quot; 還原表單內容 &quot; ></td> </tr>  </table> </form> </body> </html>
<html> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=big5&quot;> <title> 我是接收網頁 </title> </head> <body> <?php $UserName = $_POST[&quot;UserName&quot;]; $passwd = $_POST[&quot;passwd&quot;]; $Gender = $_POST[&quot;Gender&quot;]; echo &quot; 你的名字是  &quot; . $UserName .&quot;<br>&quot;; echo &quot; 你的密碼是  &quot; . $passwd .&quot;<br>&quot;; echo &quot; 你的性別是  &quot; . $Gender .&quot;<br>&quot;; ?> </body> </html> GetForm.php
Question ,[object Object],<select name=&quot;desserts&quot; size=&quot;6&quot; multiple> <option value=&quot; 珍奶 &quot;> 珍奶 <option value=&quot; 鬆餅 &quot;> 鬆餅 <option value=&quot; 蛋糕 &quot;> 蛋糕 <option value=&quot; 餅乾 &quot;> 餅乾 <option value=&quot; 比薩 &quot;> 比薩 <option value=&quot; 可頌 &quot;> 可頌 </select> <?php $desserts = $_POST[&quot;desserts&quot;]; ?>
Javascript ,[object Object],[object Object]
 
Database ,[object Object],[object Object],[object Object],Record / tuple Field
MySQL ,[object Object],[object Object],[object Object],[object Object]
MySQL 資料型態  ,[object Object],列舉 (Enumeration) , Enum 單選、 Set 複選 集合最大數目為 65535 Enum 最大長度 4294967295 個字元  (2^32-1)  LongText 最大長度 4294967295 個字元  (2^32-1)  LongBlob 最大長度  16777215  個字元 (2^24-1 MediumText 最大長度  16777215  個字元 (2^24-1)  MediumBlob 最大長度 65535 個字元 (2^16-1)  Text  最大長度 65535 個字元 (2^16-1)  Blob 最大長度 255 個字元 (2^8-1) TinyText Blob (Binary large objects) 儲存二進位資料,且有分大小寫    最大長度 255 個字元 (2^8-1) TinyBlob 可變長度 N=1~255  個字元  binary  :分辨大小寫  VarChar(N) [ binary]  固定長度 N=1~255  個字元  binary  :分辨大小寫  Char(N) [ binary]  說明 範圍 種類
MySQL 資料型態 ,[object Object],-1.79E+308~1.79E+308(  約  )  Double [(M,D)]  註:  M  為長度,  D  為小數 ,Float 4 bytes,Double 8 bytes  -3.4E+38~3.4E+38(  約  )  Float [(M,D)]    -2^63~2^63-1 UNSIGNED  :  0~2^64  BigInt[M] [UNSIGNED]    -2^31~2^31-1 UNSIGNED  :  0~2^32  Int[M] [UNSIGNED]    -8388608~8388607 UNSIGNED  : 0~16777215 MediumInt[M] [UNSIGNED]    -32768~32767 UNSIGNED  : 0~ 65535  SmallInt[M] [UNSIGNED]    -128~127  UNSIGNED  :  0~255  TinyInt[M] [UNSIGNED]  說明 範圍 種類
MySQL 資料型態 ,[object Object],  年份 yyyy Year   yyyymmddhhmmss TimeStamp   日期與時間組合 (yyyy-mm-dd hh:mm:ss) DateTime   時間 (hh:mm:ss) Time   日期 (yyyy-mm-dd) Date 說明 範圍 種類
建立一 MySQL 資料表 / 庫 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL ,[object Object],[object Object],[object Object],[object Object]
基本 SQL 語法 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CREATE ,[object Object],[object Object],[object Object],[object Object]
Create Table CREATE TABLE `award_count` ( `STU_NO`  varchar(8) NOT NULL, `AWARD_COUNT`  tinyint(4) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `depart` ( `DEPT`  char(4) NOT  NULL, `DEPT_NAME`  varchar(10)  NOT NULL, `DEPT_NAME_CH` varchar(40)  NOT NULL, `DEPT_NAME_EN` varchar(80)  default NULL, `DIV_KEY`  char(4)  NOT NULL, `IS_USED`  char(1)  default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER ALTER [ONLINE | OFFLINE] [IGNORE] TABLE tbl_name alter_specification  [, alter_specification] ... alter_specification : table_options | ADD [COLUMN] col_name column_definition [FIRST | AFTER col_name ] | ADD [COLUMN] (col_name column_definition,...) | ADD {INDEX|KEY} [index_name] | CHANGE [COLUMN] old_col_name create_definition | DROP [COLUMN] col_name | DROP PRIMARY KEY | DROP INDEX index_name ,[object Object]
Alter Table ALTER TABLE `award_count`  ADD `Remark` VARCHAR( 100 ) NULL AFTER `AWARD_COUNT` ; ALTER TABLE `award_count` DROP `remark` ; ALTER TABLE `award_count`  CHANGE `Remark` `remark` VARCHAR( 80 ) NOT NULL  ; ,[object Object],[object Object],[object Object]
DROP DROP {DATABASE | SCHEMA} [IF EXISTS] db_name DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name] ... ,[object Object],[object Object]
資料操作語言 (DML) ,[object Object],[object Object],[object Object],[object Object]
INSERT ,[object Object],INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] VALUES (expression,...),(...),... 或  INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT ... 或  INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] tbl_name SET col_name=expression, col_name=expression, ...
Insert Data Insert into `award_count` ( STU_NO , AWARD_COUNT , Remark )  values ('970001' , 2 , '97 、 98' ) ,    ('980001' , 1 , '98' ) ; Insert into `award_count`  SET STU_NO = '970001' , AWARD_COUNT = 2 , Remark = '97 、 98'; ,[object Object],[object Object]
Insert Data INSERT INTO `depart` VALUES  ('AM', ' 應數所 ', ' 應用數學研究所 ', 'Applied Mathematics', 'SCI', '0'), ('ASTR', ' 天文所 ', ' 天文研究所 ', 'Astronomy', 'SCI', '1'), ('CD', ' 計管所 ', ' 計算機決策管理研究所 ', 'Computer  and Decision Science', 'SCI', '0'), ('CHE', ' 化工系 ', ' 化學工程學系 ', 'Chemical Engineering', 'ENGI', '1'), ('CHEM', ' 化學系 ', ' 化學系 ', 'Chemistry', 'SCI', '1'), ('COM', ' 通訊所 ', ' 通訊工程研究所 ', 'Communications Engineering', 'EECS', '1'), ('CS', ' 資工系 ', ' 資訊工程學系 ', 'Computer Science', 'EECS', '1'), ('ECUP', ' 電資院學士班 ', ' 電機資訊學院學士班 ', 'Electrical Engineering & Computer Science Undergra', 'EECS', '1'), ('EE', ' 電機系 ', ' 電機工程學系 ', 'Electrical Engineering', 'EECS', '1'), ('EM', ' 工管所 ', ' 工程管理研究所 ', 'Engineering Management', 'ENGI', '0'), ('ENE', ' 電子所 ', ' 電子工程研究所 ', 'Electronic Engineering', 'EECS', '1'), ('ENGI', ' 工學院院招生 ', ' 工學院院招生 ', ' ', 'ENGI', '1'), ('IE', ' 工工系 ', ' 工業工程學系 ', 'Industrial Engineering', 'ENGI', '0'), ('IEEM', ' 工工系 ', ' 工業工程與工程管理學系 ', 'Industrial Engineering & Engineering Management', 'ENGI', '1'), ('IEM', ' 工工在職班 ', ' 工業工程與工程管理學系碩士在職專班 ', 'Industrial Engineering & Engineering Management', 'ENGI', '1'), ('IPT', ' 光電所 ', ' 光電工程研究所 ', 'Photonics Technologies', 'EECS', '1'), ('ISA', ' 資應所 ', ' 資訊系統與應用研究所 ', 'Information Systems and Applications', 'EECS', '1'), ('MATH', ' 數學系 ', ' 數學系 ', 'Mathematics', 'SCI', '1'), ('MB', ' 分生所 ', ' 分子與細胞生物研究所 ', 'Life Science', 'SCI', '0'), ('MEMS', ' 微機電所 ', ' 微機電系統工程研究所 ', 'Microelectromechanical System', 'ENGI', '0'), ('MS', ' 材料系 ', ' 材料科學工程學系 ', 'Materials Science and Engineering', 'ENGI', '1'), ('NEMS', ' 奈微所 ', ' 奈米工程與微系統研究所 ', 'Institute of NanoEngineering and MicroSystems', 'ENGI', '1'), ('OET', ' 光電專班 ', ' 產業研發碩士光電科技專班 ', 'Industrial Technology R & D Master Program on Opt', 'ENGI', '1'), ('PHYS', ' 物理系 ', ' 物理學系 ', 'Physics', 'SCI', '1'), ('PME', ' 動機系 ', ' 動力機械工程學系 ', 'Power Mechanical Engineering', 'ENGI', '1'), ('PS', ' 高分所 ', ' 高分子研究所 ', 'Polymer  Science', 'SCI', '0'), ('RDDM', ' 半導體專班 ', ' 產業研發碩士半導體元件及製程專班 ', 'Industrial  Technology  R&D  Master  Program  on', 'EECS', '1'), ('RDIC', ' 積電專班 ', ' 產業研發碩士積體電路設計專班 ', 'Industrial Technology R&D Master Program on IC Des', 'EECS', '1'), ('SCI', ' 理學院學士學程 ', ' 理學院學士學位學程 ', 'College of Science Double Major Program', 'SCI', '1'), ('STAT', ' 統計所 ', ' 統計學研究所 ', 'Statistics', 'SCI', '1'); ,[object Object]
SELECT ,[object Object],SELECT  select_expr [, select_expr ...] [FROM table_references [WHERE where_condition] [GROUP BY {col_name | expr | position} [ASC | DESC], ... [WITH ROLLUP]] [HAVING where_condition] [ORDER BY {col_name | expr | position} [ASC | DESC], ...] [LIMIT {[offset,] row_count | row_count OFFSET offset}]
Select Data select AWARD_COUNT  FROM `award_count`  where STU_NO='970001'; ,[object Object],[object Object],select *  FROM `depart`  where IS_USED = '1' Order by  DIV_KEY;
Select Data ,[object Object],Select DIV_KEY ,  count(DEPT)  FROM `depart`  where IS_USED = '1' group by DIV_KEY  Order by  DIV_KEY  DESC;
UPDATE ,[object Object],UPDATE [LOW_PRIORITY] tbl_name  SET col_name1=expr1,col_name2=expr2,... [WHERE where_definition] [LIMIT #]
Update Data Update `depart`  set IS_USED = '0'  where DIV_KEY='ENGI'; ,[object Object],Update `depart`  set IS_USED = '1'  where DIV_KEY <> 'ENGI'; ,[object Object]
DELETE ,[object Object],DELETE [LOW_PRIORITY] FROM tbl_name [WHERE where_definition] [LIMIT rows] Delete from `depart`  where IS_USED = '0' ; ,[object Object]
PHP + MySQL ,[object Object],[object Object]
mysql 函式庫 // 連結 MySQL $link = mysql_connect(&quot;mysql_host&quot;, &quot;mysql_user&quot;, &quot;mysql_password&quot;) or die(&quot;Could not connect&quot;); // 選擇 Database mysql_select_db(&quot;my_database&quot;) or die(&quot;Could not select database&quot;); ,[object Object],// 執行 SQL $result = mysql_query(&quot;Select DEPT_NAME_EN FROM `depart`  where DEPT = 'CS'&quot;)  or die(&quot;Query failed&quot;); ,[object Object]
mysql 函式庫 $result = mysql_query( &quot;Select DEPT , DEPT_NAME_CH FROM  `depart`  where DIV_KEY = 'EECS' &quot;); // 利用 mysql_fetch_row  處理查詢出來的資料   while ($row = mysql_fetch_row($result)) { echo $row[0] . &quot;&nbsp;&quot;. $row[1] . &quot;<br>&quot;; } ,[object Object],// 利用 mysql_fetch_array  處理查詢出來的資料   while ($row = mysql_fetch_array( $result, MYSQL_ASSOC)) { echo $row[&quot;DEPT&quot;] . &quot;&nbsp;&quot;. $row[&quot;DEPT_NAME_CH&quot;] . &quot;<br>&quot;; }
MySQL fetch  常數 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
mysql 函式庫 // 釋放資源 mysql_free_result($result); // 斷開連接   mysql_close($link); ,[object Object]
查詢結果出現亂碼時 // 設定伺服端編碼  mysql_query(&quot;set character_set_server = 'utf8'&quot;); // 設定客戶端編碼 mysql_query(&quot;set character_set_client = 'big5'&quot;); // 設定連結時所用編碼 mysql_query(&quot;set character_set_connection  = 'utf8'&quot;); // 設定傳回資料時所用編碼 mysql_query(&quot;set character_set_results  = 'big5'&quot;);  ,[object Object]
Homework ,[object Object]

Contenu connexe

Tendances

Introduction to Parse JavaScript SDK
Introduction to Parse JavaScript SDKIntroduction to Parse JavaScript SDK
Introduction to Parse JavaScript SDK維佋 唐
 
Php extension开发
Php extension开发Php extension开发
Php extension开发thinkinlamp
 
PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术hoopchina
 
Learning python in the motion picture industry by will zhou
Learning python in the motion picture industry   by will zhouLearning python in the motion picture industry   by will zhou
Learning python in the motion picture industry by will zhouWill Zhou
 
常見設計模式介紹
常見設計模式介紹常見設計模式介紹
常見設計模式介紹Jace Ju
 
Symfony簡介
Symfony簡介Symfony簡介
Symfony簡介Ricky Su
 
Ptyhon 教學 001 程式流程控制(if-elif-else)
Ptyhon 教學 001 程式流程控制(if-elif-else)Ptyhon 教學 001 程式流程控制(if-elif-else)
Ptyhon 教學 001 程式流程控制(if-elif-else)信宏 陳
 
JavaScript现代化排错实践
JavaScript现代化排错实践JavaScript现代化排错实践
JavaScript现代化排错实践jeffz
 
20100116 02 同一カテゴリの投稿を一覧表示する
20100116 02 同一カテゴリの投稿を一覧表示する20100116 02 同一カテゴリの投稿を一覧表示する
20100116 02 同一カテゴリの投稿を一覧表示するTakashi Uemura
 
Free Marker中文文档
Free Marker中文文档Free Marker中文文档
Free Marker中文文档yiditushe
 
系統程式 -- 第 8 章 編譯器
系統程式 -- 第 8 章 編譯器系統程式 -- 第 8 章 編譯器
系統程式 -- 第 8 章 編譯器鍾誠 陳鍾誠
 
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VM
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VMCompiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VM
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VMLi Hsuan Hung
 
Python 入门
Python 入门Python 入门
Python 入门kuco945
 
系統程式 -- 第 7 章 高階語言
系統程式 -- 第 7 章 高階語言系統程式 -- 第 7 章 高階語言
系統程式 -- 第 7 章 高階語言鍾誠 陳鍾誠
 
cfm to php training
cfm to php training cfm to php training
cfm to php training Chonpin HSU
 

Tendances (18)

Introduction to Parse JavaScript SDK
Introduction to Parse JavaScript SDKIntroduction to Parse JavaScript SDK
Introduction to Parse JavaScript SDK
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
Php extension开发
Php extension开发Php extension开发
Php extension开发
 
PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术
 
Learning python in the motion picture industry by will zhou
Learning python in the motion picture industry   by will zhouLearning python in the motion picture industry   by will zhou
Learning python in the motion picture industry by will zhou
 
常見設計模式介紹
常見設計模式介紹常見設計模式介紹
常見設計模式介紹
 
Symfony簡介
Symfony簡介Symfony簡介
Symfony簡介
 
Op 20090411
Op 20090411Op 20090411
Op 20090411
 
Ptyhon 教學 001 程式流程控制(if-elif-else)
Ptyhon 教學 001 程式流程控制(if-elif-else)Ptyhon 教學 001 程式流程控制(if-elif-else)
Ptyhon 教學 001 程式流程控制(if-elif-else)
 
JavaScript现代化排错实践
JavaScript现代化排错实践JavaScript现代化排错实践
JavaScript现代化排错实践
 
20100116 02 同一カテゴリの投稿を一覧表示する
20100116 02 同一カテゴリの投稿を一覧表示する20100116 02 同一カテゴリの投稿を一覧表示する
20100116 02 同一カテゴリの投稿を一覧表示する
 
Free Marker中文文档
Free Marker中文文档Free Marker中文文档
Free Marker中文文档
 
系統程式 -- 第 8 章 編譯器
系統程式 -- 第 8 章 編譯器系統程式 -- 第 8 章 編譯器
系統程式 -- 第 8 章 編譯器
 
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VM
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VMCompiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VM
Compiler for Dummy 一點都不深入的了解 Compiler, Interpreter 和 VM
 
Python 入门
Python 入门Python 入门
Python 入门
 
系統程式 -- 第 7 章 高階語言
系統程式 -- 第 7 章 高階語言系統程式 -- 第 7 章 高階語言
系統程式 -- 第 7 章 高階語言
 
Fp
FpFp
Fp
 
cfm to php training
cfm to php training cfm to php training
cfm to php training
 

En vedette

Biometrics overview ppt
Biometrics overview pptBiometrics overview ppt
Biometrics overview pptamee yaami
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練Abner Huang
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練Abner Huang
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練Abner Huang
 
成為一個好產品經理的人格特質 rubykuan
成為一個好產品經理的人格特質    rubykuan成為一個好產品經理的人格特質    rubykuan
成為一個好產品經理的人格特質 rubykuanRuby Kuan 關芸如
 
Biometrics in UX Research: The Next Big Step
Biometrics in UX Research: The Next Big StepBiometrics in UX Research: The Next Big Step
Biometrics in UX Research: The Next Big StepDan Berlin
 
Biometrics proposition
Biometrics propositionBiometrics proposition
Biometrics propositionEwan Rawlings
 
Bluetooth based smart sensor devices 2
Bluetooth based smart sensor devices 2Bluetooth based smart sensor devices 2
Bluetooth based smart sensor devices 2Vijay Kribpz
 
Biometrics Technology Intresting PPT
Biometrics Technology Intresting PPT Biometrics Technology Intresting PPT
Biometrics Technology Intresting PPT preeti tripathi
 
Final Report Biometrics
Final Report BiometricsFinal Report Biometrics
Final Report Biometricsanoop80686
 
Biometric authentication ppt by navin 6 feb
Biometric authentication ppt by navin 6 febBiometric authentication ppt by navin 6 feb
Biometric authentication ppt by navin 6 febNavin Kumar
 
BIOMETRIC IDENTIFICATION IN ATM’S PPT
BIOMETRIC IDENTIFICATION IN ATM’S  PPTBIOMETRIC IDENTIFICATION IN ATM’S  PPT
BIOMETRIC IDENTIFICATION IN ATM’S PPTsravya raju
 
A study on biometric authentication techniques
A study on biometric authentication techniquesA study on biometric authentication techniques
A study on biometric authentication techniquesSubhash Basistha
 

En vedette (20)

BSI Biometrics Standards Presentation
BSI Biometrics Standards PresentationBSI Biometrics Standards Presentation
BSI Biometrics Standards Presentation
 
A86eseminar on biometrics
A86eseminar on biometricsA86eseminar on biometrics
A86eseminar on biometrics
 
Biometrics overview ppt
Biometrics overview pptBiometrics overview ppt
Biometrics overview ppt
 
Biometrics security
Biometrics securityBiometrics security
Biometrics security
 
產品企劃與開發過程
產品企劃與開發過程產品企劃與開發過程
產品企劃與開發過程
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練2009 CSBB LAB 新生訓練
2009 CSBB LAB 新生訓練
 
成為一個好產品經理的人格特質 rubykuan
成為一個好產品經理的人格特質    rubykuan成為一個好產品經理的人格特質    rubykuan
成為一個好產品經理的人格特質 rubykuan
 
PM 的工作與職責
PM 的工作與職責PM 的工作與職責
PM 的工作與職責
 
Biometrics in UX Research: The Next Big Step
Biometrics in UX Research: The Next Big StepBiometrics in UX Research: The Next Big Step
Biometrics in UX Research: The Next Big Step
 
Biometrics
BiometricsBiometrics
Biometrics
 
Biometrics proposition
Biometrics propositionBiometrics proposition
Biometrics proposition
 
Biometrics final ppt
Biometrics final pptBiometrics final ppt
Biometrics final ppt
 
Bluetooth based smart sensor devices 2
Bluetooth based smart sensor devices 2Bluetooth based smart sensor devices 2
Bluetooth based smart sensor devices 2
 
Biometrics Technology Intresting PPT
Biometrics Technology Intresting PPT Biometrics Technology Intresting PPT
Biometrics Technology Intresting PPT
 
Final Report Biometrics
Final Report BiometricsFinal Report Biometrics
Final Report Biometrics
 
Biometric authentication ppt by navin 6 feb
Biometric authentication ppt by navin 6 febBiometric authentication ppt by navin 6 feb
Biometric authentication ppt by navin 6 feb
 
BIOMETRIC IDENTIFICATION IN ATM’S PPT
BIOMETRIC IDENTIFICATION IN ATM’S  PPTBIOMETRIC IDENTIFICATION IN ATM’S  PPT
BIOMETRIC IDENTIFICATION IN ATM’S PPT
 
A study on biometric authentication techniques
A study on biometric authentication techniquesA study on biometric authentication techniques
A study on biometric authentication techniques
 

Similaire à 2009 CSBB LAB 新生訓練

Ruby程式語言入門導覽
Ruby程式語言入門導覽Ruby程式語言入門導覽
Ruby程式語言入門導覽Mu-Fan Teng
 
Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)amd6400
 
Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)amd6400
 
第五章解答
第五章解答第五章解答
第五章解答jiannrong
 
HTML5移动WEB应用程序开发(PhoneGap)
HTML5移动WEB应用程序开发(PhoneGap)HTML5移动WEB应用程序开发(PhoneGap)
HTML5移动WEB应用程序开发(PhoneGap)amd6400
 
HTML5移动应用开发分享会(PhoneGap)
HTML5移动应用开发分享会(PhoneGap)HTML5移动应用开发分享会(PhoneGap)
HTML5移动应用开发分享会(PhoneGap)amd6400
 
1 C入門教學
1  C入門教學1  C入門教學
1 C入門教學Sita Liu
 
Bash shell script 教學
Bash shell script 教學Bash shell script 教學
Bash shell script 教學Ming-Sian Lin
 
Effective linux.1.(commandline)
Effective linux.1.(commandline)Effective linux.1.(commandline)
Effective linux.1.(commandline)wang hongjiang
 
Erlang培训
Erlang培训Erlang培训
Erlang培训liu qiang
 
Php for fe
Php for fePhp for fe
Php for fejay li
 
PHP 語法基礎與物件導向
PHP 語法基礎與物件導向PHP 語法基礎與物件導向
PHP 語法基礎與物件導向Shengyou Fan
 
2, bash synax simplified
2, bash synax simplified2, bash synax simplified
2, bash synax simplifiedted-xu
 
YUI ─ 阿大
YUI ─ 阿大YUI ─ 阿大
YUI ─ 阿大taobao.com
 
Hello Javascript
Hello JavascriptHello Javascript
Hello JavascriptBaidu, Inc.
 
Batch 溫故/知新
Batch 溫故/知新Batch 溫故/知新
Batch 溫故/知新奕浦 郭
 
关于Js的跨域操作
关于Js的跨域操作关于Js的跨域操作
关于Js的跨域操作王 承石
 
Smart fox簡報
Smart fox簡報Smart fox簡報
Smart fox簡報Jones Yu
 
training and sharing about clean code
training and sharing about clean codetraining and sharing about clean code
training and sharing about clean codeChonpin HSU
 

Similaire à 2009 CSBB LAB 新生訓練 (20)

Ruby程式語言入門導覽
Ruby程式語言入門導覽Ruby程式語言入門導覽
Ruby程式語言入門導覽
 
Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)
 
Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)Html5移动web应用开发(PhoneGap)
Html5移动web应用开发(PhoneGap)
 
第五章解答
第五章解答第五章解答
第五章解答
 
PHP
PHPPHP
PHP
 
HTML5移动WEB应用程序开发(PhoneGap)
HTML5移动WEB应用程序开发(PhoneGap)HTML5移动WEB应用程序开发(PhoneGap)
HTML5移动WEB应用程序开发(PhoneGap)
 
HTML5移动应用开发分享会(PhoneGap)
HTML5移动应用开发分享会(PhoneGap)HTML5移动应用开发分享会(PhoneGap)
HTML5移动应用开发分享会(PhoneGap)
 
1 C入門教學
1  C入門教學1  C入門教學
1 C入門教學
 
Bash shell script 教學
Bash shell script 教學Bash shell script 教學
Bash shell script 教學
 
Effective linux.1.(commandline)
Effective linux.1.(commandline)Effective linux.1.(commandline)
Effective linux.1.(commandline)
 
Erlang培训
Erlang培训Erlang培训
Erlang培训
 
Php for fe
Php for fePhp for fe
Php for fe
 
PHP 語法基礎與物件導向
PHP 語法基礎與物件導向PHP 語法基礎與物件導向
PHP 語法基礎與物件導向
 
2, bash synax simplified
2, bash synax simplified2, bash synax simplified
2, bash synax simplified
 
YUI ─ 阿大
YUI ─ 阿大YUI ─ 阿大
YUI ─ 阿大
 
Hello Javascript
Hello JavascriptHello Javascript
Hello Javascript
 
Batch 溫故/知新
Batch 溫故/知新Batch 溫故/知新
Batch 溫故/知新
 
关于Js的跨域操作
关于Js的跨域操作关于Js的跨域操作
关于Js的跨域操作
 
Smart fox簡報
Smart fox簡報Smart fox簡報
Smart fox簡報
 
training and sharing about clean code
training and sharing about clean codetraining and sharing about clean code
training and sharing about clean code
 

2009 CSBB LAB 新生訓練

  • 1. PHP + HTML + MySQL + Smarty Speaker :張智宏
  • 2.
  • 3.
  • 4.  
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. Appserv 安裝 Figure 2  GNU/GPL License Agreement screen.   Figure 1  AppServ Welcome Screen
  • 12. Appserv 安裝 Figure 3  Choose Install location screen. Figure 4  Choose Package Components screen.
  • 13. Appserv 安裝 Figure 5  Apache Web Server configure screen. Figure 6  MySQL Database configure screen.
  • 14.
  • 15. Appserv 安裝 http://localhost http://localhost/phpinfo.php ( 需要事先建立 phpinfo.php , 稍後講述 )
  • 16. Appserv 安裝 http://localhost/phpMyAdmin ( 帳號: root 密碼: 安裝時設定的密碼 ) 如果以上三個網頁皆成功顯示出來,代表安裝成功。
  • 17. PHP 程式起始標記 <? php ehco (“Hello World!!”); // 單行註解 /* 這是 多行註解 */ ?> <? ehco (“Hello World!!”); // 單行註解 /* 這是 多行註解 */ ?> <script language=“php”> ehco (“Hello World!!”); // 單行註解 /* 這是 多行註解 */ </script>
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. foreach // 架構一 foreach ($animals as $value){ echo $value . &quot; &quot; ; } /* 印出的結果 cat dog bird turtle */ // 架構二 foreach ($animals as $key => $value){ echo $key . &quot; - &quot;. $value . &quot;&quot;; } /* 印出的結果 0 - cat 1 - dog 2 - bird 3 - turtle */ //animal Array $animals = array ( &quot;cat&quot; , &quot;dog&quot; , &quot;bird&quot; , &quot;turtle“ ); // 利用 while Wihle(list ($key , $value) = each($animals)) { echo $key . &quot; – &quot;. $value . &quot;&quot;; } /* 印出的結果 0 - cat 1 - dog 2 - bird 3 - turtle */
  • 43. foreach // 二維陣列 $team_member = array( &quot;team1&quot; => array( &quot;Tom&quot; , &quot;Bob&quot;) , &quot;team2&quot; => array( &quot;Sue&quot; , &quot;John &quot; ) , &quot;team3&quot; => array( &quot;Ann&quot; , &quot;Joe&quot;) ); foreach ($team_member as $team_name => $team){ echo $team_name . &quot; : &quot; ; foreach ($team as $member){ echo $member . &quot; : &quot; ; } echo &quot; : &quot; ; } /* 印出結果 team1 : Tom Bob team2 : Sue John team3 : Ann Joe */
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71. <html> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=big5&quot;> <title> 網頁標題 </title> </head> <body> <form name=&quot;form1&quot; action=&quot;GetForm.php&quot; method=&quot;POST&quot;> <table border=&quot;1&quot; width=&quot;250&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;> <tr> <td align=&quot;right&quot;> 姓名: </td> <td><input type=&quot;text&quot; name=&quot;UserName&quot; value=&quot;&quot; size=&quot;8&quot;></td> </tr> <tr> <td align=&quot;right&quot;> 密碼: </td> <td><input type=&quot;password&quot; name=&quot;passwd&quot; value=&quot;&quot; size=&quot;8&quot; ></td> </tr> <tr> <td align=&quot;right&quot;> 性別: </td> <td><input type=&quot;radio&quot; name=&quot;Gender&quot; value=&quot; 男 &quot;> 男 <input type=&quot;radio&quot; name=&quot;Gender&quot; value=&quot; 女 &quot;> 女 </td> </tr> <tr> <td colspan=&quot;2&quot; align=&quot;center&quot;> <input type=&quot;submit&quot; name=&quot;sendit&quot; value=&quot; 送出表單 &quot; > &nbsp;&nbsp; <input type=&quot;reset&quot; name=&quot;clear_form&quot; value=&quot; 還原表單內容 &quot; ></td> </tr> </table> </form> </body> </html>
  • 72. <html> <head> <meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=big5&quot;> <title> 我是接收網頁 </title> </head> <body> <?php $UserName = $_POST[&quot;UserName&quot;]; $passwd = $_POST[&quot;passwd&quot;]; $Gender = $_POST[&quot;Gender&quot;]; echo &quot; 你的名字是 &quot; . $UserName .&quot;<br>&quot;; echo &quot; 你的密碼是 &quot; . $passwd .&quot;<br>&quot;; echo &quot; 你的性別是 &quot; . $Gender .&quot;<br>&quot;; ?> </body> </html> GetForm.php
  • 73.
  • 74.
  • 75.  
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85. Create Table CREATE TABLE `award_count` ( `STU_NO` varchar(8) NOT NULL, `AWARD_COUNT` tinyint(4) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `depart` ( `DEPT` char(4) NOT NULL, `DEPT_NAME` varchar(10) NOT NULL, `DEPT_NAME_CH` varchar(40) NOT NULL, `DEPT_NAME_EN` varchar(80) default NULL, `DIV_KEY` char(4) NOT NULL, `IS_USED` char(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.