Introduction to PHP 5 with Sqlite

Introduction to PHP 5 with Sqlite

Introduction to PHP 5 with SQLite By Svein Nordbotten, Professor Emeritus University of Bergen, Norway Bergen, September 2010 Contents About the course. ......................................................................................................................................... 6 Session 1: Static web applications ................................................................................................................ 7 Basics ..................................................................................................................................................... 7 Web applications .................................................................................................................................. 7 HTML - Hypertext Markup Language .................................................................................................... 8 HTML Format ........................................................................................................................................ 9 Texts ...................................................................................................................................................... 9 Links .................................................................................................................................................... 10 Images ................................................................................................................................................. 11 Lists ..................................................................................................................................................... 11 Tables .................................................................................................................................................. 12 Forms .................................................................................................................................................. 13 Frames ................................................................................................................................................. 14 CSS, JavaScript, and XML ..................................................................................................................... 15 Session 2: Dynamic applications in PHP .................................................................................................. 16 Dynamic web sites .............................................................................................................................. 16 CGI and PERL ....................................................................................................................................... 17 Applications Program Interfaces ......................................................................................................... 18 PHP Language ...................................................................................................................................... 18 Approach in this course ...................................................................................................................... 19 Simple example ................................................................................................................................... 19 Guessing example ............................................................................................................................... 21 Session 3: Dynamic application without database ............................................................................. 24 Market research .................................................................................................................................. 24 System design ..................................................................................................................................... 24 Market research .................................................................................................................................. 26 Market analysis ................................................................................................................................... 30 Session 4: Introducing the SQLite database ........................................................................................... 33 Dynamic applications and databases .................................................................................................. 33 SQLite .................................................................................................................................................. 33 Creation of a reference database to you personal library. ................................................................. 33 Menu page .......................................................................................................................................... 35 Creating and populating a database ................................................................................................... 36 Listing the content of the database .................................................................................................... 38 Searching the database for a book reference. .................................................................................... 39 Updating book references in the database......................................................................................... 42 Deleting rows in the database ............................................................................................................ 46 Removing all content in the booktable ............................................................................................... 47 Session 5: Application with SQLite database .......................................................................................... 49 Opinion polls ....................................................................................................................................... 49 Application design ............................................................................................................................... 49 Application menu ................................................................................................................................ 50 Creating records and a list of panel members .................................................................................... 51 Processing, statistics and rotation ...................................................................................................... 55 Session 6: Functions in PHP .................................................................................................................... 60 Functions ................................................................................................................................................. 60 Authorization and authentication ........................................................................................................... 61 Table existence test ............................................................................................................................ 65 Authorization ...................................................................................................................................... 66 PIN code assignment ........................................................................................................................... 66 Authentication .................................................................................................................................... 67 Function library ................................................................................................................................... 68 Logging .................................................................................................................................................... 68 Logging function .................................................................................................................................. 69 Example environment ......................................................................................................................... 69 Session 7: File processing ........................................................................................................................ 71 Maintaining files.................................................................................................................................. 71 Fetching files ....................................................................................................................................... 71 Uploading files .................................................................................................................................... 74 Session 8: Object-Orientation in PHP ..................................................................................................... 79 Object-oriented interface ................................................................................................................... 79 Object-oriented syntax ....................................................................................................................... 79 SQLite OO interface syntax ................................................................................................................. 83 Session 9: Login class .............................................................................................................................. 86 Authentication

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    99 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us