1 / 78

PHP on a F ast Track and other web development techniques

PHP on a F ast Track and other web development techniques. a quick introduction to web programming b y Jarek Francik. Teaching Objectives. To ensure everyone of you have at least basic understanding of server-side processing To introduce some basic PHP

kueng
Download Presentation

PHP on a F ast Track and other web development techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP on a Fast Trackand other web development techniques a quick introduction to web programming by JarekFrancik

  2. Teaching Objectives • To ensure everyone of you have at least basic understanding of server-side processing • To introduce some basic PHP • To demonstrate what makes a good web project (and what doesn’t)

  3. What is a project? A project is a temporary endeavour undertaken to create a uniqueproduct or service

  4. A project is... • a defined, unique venture or undertaking, that • requires the effort or activities of people • who have defined roles and responsibilities • within a finite life-span, time-scale or schedule • using specified resources and budgets, and • has specific goals or objectives to achieve • to which measures of quality can be applied • that brings about some change in the status quo • to provide sustainable benefitto some business, organisational or individual need

  5. Project Snettisham

  6. Project Snettisham Research: • 50,000 birds swirling like smoke clouds • Oystercatchers, godwits, knots... • Snettisham RSPB Reserve in Norfolk • Best time: autumn, when most birds migrate  LOOK FOR MORE INFORMATION!

  7. Project Snettisham Research (cont.): • The flocks take to the air as the high tide races in, covering their feeding grounds. They sit out high tide and return once the tide falls • Spectaculars happen only in the mornings • The higher the tidethe better chances to see it!

  8. Project Snettisham • Need a really high tide early in the morning... • UK Tides (Apple Store) USE PROPER TOOLS!

  9. Project Snettisham • Need a really high tide early in the morning... • UK Tides (Apple Store) • Timetables ready on the RSPB site! USE VARIOUS SOURCES OF INFORMATION

  10. Project Snettisham • Need a really high tide early in the morning... • UK Tides (Apple Store) • Timetables ready on the RSPB site! • Three days trip 17-19 Nov (to also see the Pink Footed Geese!) PLANNING IS CRUCIAL

  11. Project Snettisham • Need a really high tide early in the morning... • UK Tides (Apple Store) • Timetables ready on the RSPB site! • Three days trip 17-19 Nov (to also see the Pink Footed Geese!) • Accommodation! PLANNING IS CRUCIAL

  12. Project Snettisham • Need a really high tide early in the morning... • UK Tides (Apple Store) • Timetables ready on the RSPB site! • Three days trip 17-19 Nov to see the Pink Footed Geese as well! • Accomodation! • Transport... • Anything else... PLANNING IS CRUCIAL

  13. What is a project? A project is a temporary endeavour undertaken to create a uniqueproduct or service • Snettisham Trip is a project • A trip to Winkworth Arboretum last Saturday wasn’t a project why?

  14. What is a project? A project is a temporary endeavour undertaken to create a uniqueproduct or service • A bespoke e-commerce solution for a company who need it is a project • A novel HCI solution is a project • A routine PC maintenance is not a project why?

  15. What is a project? A project is a temporary endeavour undertaken to create a uniqueproduct or service • A typical on-line store for a small company...hardly is a good project why?

  16. PHP on a Fast Track

  17. Client & Server Client Server

  18. Client & Server Client Server

  19. Client & Server Remote File System Client Server

  20. Client & Server Remote File System REQUEST: GET RESPONSE: HTML Client Server

  21. Client & Server Remote File System CLIENT SIDE PROCESSING REQUEST: GET RESPONSE: HTML Files served over the network may contain HTML, CSS, JavaScript,Flash and may be pretty much complex! Client Server

  22. Client & Server Remote File System REQUEST: GET RESPONSE: HTML Client Server

  23. Client & Server Remote File System REQUEST: GET RESPONSE: HTML REQUEST: GET RESPONSE: HTML Client Server

  24. Client & Server Remote File System REQUEST: POST RESPONSE: HTML REQUEST: POST DB RESPONSE: HTML Client Server

  25. Client & Server Remote File System REQUEST: POST RESPONSE: PHP REQUEST: POST DB RESPONSE: PHP Great Hiking Shoe Perfect Company Client Server SERVER SIDE PROCESSING

  26. Client-Side Processing Server-Side Processing DB

  27. Client-Side Processing Server-Side Processing Executed remotely, on a web server Results must be sent over the network Network latency Pages must be re-loaded in order to view the results* Information easily shared Database back-end Flexible and powerful security control * AJAX technology allows for remote updates without pages being reloaded but technically it is a combination of server side and client side technologies • Executed locally, on client’s computer • Results visible immediately • Fast & dynamic • Processing within a single webpage • Information cannot be shared • No Databases* • Keeping things secret is very difficult – everything is on the user’s computer * Limited local database functionality is available in HTML5, but without sharing

  28. PHP • Scripting language for web development • Created by RasmusLerdorf 16 years ago • Currently phasing out • Easy to learn but time-consuming to use

  29. Let’s writea shopping cart application

  30. What do we need? • Operating System • Web Server • Database • Scripring Language Windows, Linux, MacOS... Appache, IIS, WEBrick... MySQL, Postgres, SQLite, Oracle... PHP, Perl, Python, Ruby, C#, Java... DB

  31. What do we need? • Operating System • Web Server • Database • Scripring Language Windows, Linux, MacOS... Appache, IIS, WEBrick... MySQL, Postgres, SQLite, Oracle... PHP, Perl, Python, Ruby, C#, Java... DB

  32. What do we need? • Operating System • Web Server • Database • Scripring Language Linux, Windows, MacOS... Appache, IIS, WEBrick... MySQL, Postgres, SQLite, Oracle... PHP, Perl, Python, Ruby, C#, Java... DB

  33. What do we need? • Operating System • Web Server • Database • Scripring Language MacOS, Windows, Linux... Appache, IIS, WEBrick... MySQL, Postgres, SQLite, Oracle... PHP, Perl, Python, Ruby, C#, Java... DB

  34. What do we need? • Operating System • Web Server • Database • Scripring Language X - Platform Appache MySQL PHP Perl DB

  35. What do we need? • Operating System • Web Server • Database • Scripring Language X A M P P DB

  36. XAMPP http://www.apachefriends.org/en/xampp.html or google for “xampp”

  37. XAMPP • Download and install – it’s easy • Run XAMPP Control Panel • Start Apache & MySql • Run in your browser:http://localhost • Click Explore and goto htdocsto browseyour web files • Use MySql Admin tosetup your databasewith mySqlAdmin

  38. phpMyAdmin

  39. phpMyAdmin

  40. phpMyAdmin

  41. phpMyAdmin

  42. phpMyAdmin

  43. phpMyAdmin

  44. KU Server • There is a web server available for you at http://studentnet.kingston.ac.uk • Find all details there (or check the end of this presentation)

  45. Database structure (SQL) USE test; CREATE TABLE goods ( id int(6) unsigned NOT NULL auto_increment, item varchar(100) NOT NULL default '', price decimal(6,2) NOT NULL default '0.00', image varchar(100) NOT NULL default '', PRIMARY KEY (id) ); INSERT INTO goods VALUES (1, 'Soap', '4.99'); INSERT INTO goods VALUES (2, 'Strawberry Jam', '1.99'); INSERT INTO goods VALUES (3, 'Toothpaste', '2.49'); INSERT INTO goods VALUES (4, '8GB Memory Stick', '22.99');

  46. The First PHP File <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Your Cart</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Your Cart</h1> <?php ?> </body> </html> cart.php 0

  47. The First PHP File <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Your Cart</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Your Cart</h1> <?php echo "Hello, world!"; ?> </body> </html> cart.php

More Related