Week01 jan19 introductionto_php

25
Introduc)on to PHP TCNJ – Web Design 2 : Dynamic By Jean Ho Chu Week 01. Jan 19. 2012

description

 

Transcript of Week01 jan19 introductionto_php

Page 1: Week01 jan19 introductionto_php

Introduc)on  to  PHP  

TCNJ  –  Web  Design  2  :  Dynamic  

By  Jean  Ho  Chu  Week  01.  Jan  19.  2012  

Page 2: Week01 jan19 introductionto_php

What  is  Dynamic  Website?  

Dynamic  Website  •  ASP.NET,  JSP,  Ruby  on  rail,  PHP,  etc    

•  Scrip)ng  language  

•  Generates  the  code  for  the  site  •  Acts  on  the  server,  lives  on  the  server  

•  Server  Side  Programming  

•  Back  End  Development  

•  Has  memories  

•  Responsive,  malleable  

•  More  difficult  to  develop  the  ini)al  website  

Sta/c  Website  •  HTML,  Javascript,  etc  

•  Compiled  language    

•  Only  displays  pages  •  Acts,  lives  anywhere  clients  are  

•  Client  Side  Programming  

•  Front  End  Development  

•  No  memories  

•  Not  responsive  

•  Quick  and  cheap  to  develop  the  ini)al  website  

Page 3: Week01 jan19 introductionto_php

This  is  Sta)c  HTML  Website…  

Page 4: Week01 jan19 introductionto_php

This  is  Dynamic  Website  !  

+   =  

Molds  &  Frames   Contents  Fast,  Clean,  Easy  Diverse  results!  

Contents  are  provided  by  users  or  from  databases  

Server  side  code  provides    templates  from  the  server  

The  html  page  of    what  the  users  see  is    generated!  

Page 5: Week01 jan19 introductionto_php

What  is  Client  ?  Server?  

Client  

•  Visible  Nature  Server  

•  Invisible  God  

Page 6: Week01 jan19 introductionto_php

What  is  Client  ?  Server?  

Client  

•  From  your  computer  

•  All  the  user  interac)ons  happen  from  the  client  

Server  

•  From  the  hos)ng  service  

•  Never  shown  directly,  performs  and  executes  on  the  browser  

Page 7: Week01 jan19 introductionto_php

Stolen  from  my  professor  -­‐  

Page 8: Week01 jan19 introductionto_php

What  is  PHP?  

•  PHP  :  “Hypertext  Preprocessor.”  

•  “Widely  used  general-­‐purpose  scrip)ng  language  that  is  especially  suited  for  Web  development  and  can  be  embedded  into  HTML.”      -­‐  from  www.php.net-­‐  

Page 9: Week01 jan19 introductionto_php

How  does  PHP  act?  

User  

From  Codin’  for  the  web  Codin’  for  the  Web,  CHARLES  WYKE-­‐SMITH  

Page 10: Week01 jan19 introductionto_php

How  to  use?  

•  Can  be  embedded  into  HTML  page  

•  Starts  with      <?php  •  Closes  with        ?>  

<!DOCTYPE  html  PUBLIC  "-­‐//W3C//DTD  XHTML  1.0  Transi)onal//EN"  

  "hkp://www.w3.org/TR/xhtml1/DTD/xhtml1-­‐transi)onal.dtd">  

<html  xmlns="hkp://www.w3.org/1999/xhtml"  xml:lang="en"  lang="en">  

<head>     <meta  hkp-­‐equiv="Content-­‐Type"  content="text/

html;  charset=un-­‐8"/>     <)tle>Who  are  you?</)tle>  </head>  

<body>  <?php    

print  "Hello";  

?>  

</body>  </html>  

Page 11: Week01 jan19 introductionto_php

What  is  Database?  

•  A  database  is  a  collec)on  of  tables  (made  up  of  columns  and  rows)  that  stores  informa)on.    

Page 12: Week01 jan19 introductionto_php

What  is  MySQL?  

• MySQL  :  most  popular  open-­‐source  database  •  Database  Management  System  (DBMS)  

•  Cf  )    Oracle  and  Microsor’s  SQL  Serve  are  also  database,  and  are  compe)tors  to  MySQL  

Page 13: Week01 jan19 introductionto_php

PHP  &  mySQL  

Page 14: Week01 jan19 introductionto_php

How  to  use?  

•   PHP’s  mysql_query()   •  $result  =  mysql_query(SQL  command,  ➝  database  connec)on);  

Page 15: Week01 jan19 introductionto_php

Why  use  PHP  and  MySQL?  

•  Easy  to  edit  and  update  •  Let  the  users  fill  in  the  space  (ex  :  facebook  my  pages,  blogs,  etc…)  

•  Save  and  Access  to  Database  (impossible  with  html)  

•  and  more…  

All  in  all,  TO  MAKE  A  DYNAMIC  WEBSITE  

Page 16: Week01 jan19 introductionto_php

Examples  of  Dynamic  Websites  

Page 17: Week01 jan19 introductionto_php

wordpress  Framework  and  template  for  making  pornolio  websites  and  blog  

-­‐>    To  edit  and  update  easily  

Page 18: Week01 jan19 introductionto_php

wordpress  Framework  and  template  for  making  pornolio  websites  and  blog  

-­‐>    To  edit  and  update  easily  

Page 19: Week01 jan19 introductionto_php

shopify  Framework  and  template  for  making  shopping  mall.  

-­‐>    To  remember  user’s  interac)ons  

Page 20: Week01 jan19 introductionto_php

facebook  Social  networking  service  

-­‐>  To  provide  a  planorm  for  the  users  to  fill  in  and  share  the  contents  

Page 21: Week01 jan19 introductionto_php

ny/mes  All  about  organizing  data  

Page 22: Week01 jan19 introductionto_php

Data  visualiza/on  Ny)mes  interac)ve  graphics  

-­‐>  To  provide  real  )me  interac)ve  data  visualiza)on  

Page 23: Week01 jan19 introductionto_php

Wefeelfine.org  Web  project  to  sort  and  view  blog  posts  with  emo)onal  contents  

-­‐>  To  provide  a  different  interface  and  meaning  for  the  web  

Page 24: Week01 jan19 introductionto_php

Interac/ve  Web  Art  Projects  Aaron  Koblin,  Ten  Thousand  Cents  

-­‐>  To  explore  new  possibili)es  for  engaging  users  as  part  of  the  art  project  

Page 25: Week01 jan19 introductionto_php

YOUR  WORK  GOES  HERE  

Please  do  not  hesitate  to  explore  with  crea)ve  projects  engaging  dynamic  web  technologies      

?