Application design – setting up

Slides:



Advertisements
Similar presentations
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
Advertisements

Selected Topics Dr Yi Zhou
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
The Collections Keeper A collections management system Brian J. Mullen.
NMD202 Web Scripting Week5. What we will cover today PHPmyAdmin Debugging – using print_r Modifying Data PHP (cont.) 4D Methodology File and IO operations.
Drupal Online Tutorial A Product of an ENGL 421 class at Purdue University Page 1.
Content Management, Working with WordPress Pavel Ivanov Telerik Corporation
Content Management, Working with WordPress Svetlin Nakov Telerik Corporation
Content Management, Working with WordPress Svetlin Nakov Telerik Corporation
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
Purdue Pride Joe Gutierrez Tung Ho Janam Jhaveri 4/30/2010Purdue Pride1.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
PHP and SQL Server: Queries IST2101. Project Report 4 SQL Queries Due Sunday, 4/5 at 11:59pm Instructions on how to access team webspace and SQL database.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
1 Spidering the Web in Python CSC 161: The Art of Programming Prof. Henry Kautz 11/23/2009.
PHP Security.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Creating a Basic Web Page
Session 5: Working with MySQL iNET Academy Open Source Web Development.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
PHP INCLUDES FOR MODULARIZATION CIT 230 – WEB FRONT-END DEVELOPMENT.
Python CGI programming
Online Translation Service Capstone Design Eunyoung Ku Jason Roberts Jennifer Pitts Gregory Woodburn Kim Tran.
CakePHP is an open source web development framework. It follows Model-View- Controller and is developed using PHP. IT is the basic for user to create.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
PHP Features. Features Clean syntax. Object-oriented fundamentals. An extensible architecture that encourages innovation. Support for both current and.
Web Design (7) Images (1). Images and the Image Element Images can be placed in the flow of text..jpg,.png and.gif image files work in web pages The img.
1Computer Sciences Department Princess Nourah bint Abdulrahman University.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
CHAPTER 9 PHP AND MYSQL. A POSSIBLE SITE CONFIGURATION Application Folder index.php includes (folder)header.phpfooter.phpstyle.cssmodel (folder)mysqli_connect.php.
14. Uploading Files to MySQL Database. M. Udin Harun Al Rasyid, S.Kom, Ph.D Desain dan.
Creating PHPs to Insert, Update, and Delete Data CS 320.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
2010/11 : [1]PHP with MySQLBuilding Web Applications using MySQL and PHP (W1) PHP with MySQL.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Drush: The Drupal Shell Utility Trevor Mckeown Founder & Owner Sublime Technologies
Packaging for Voracity Solutions Control Panel David Turner.
Module 8 : Configuration II Jong S. Bok
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
WAMP Windows Apache MySQL and PHP i.e. “WAMP”. Why WAMP? WampServer is a Windows web development environment. It allows you to create and test web pages.
PHP “Personal Home Page Hypertext Pre-processor” (a recursive acronym) Allows you to create dynamic web pages and link web pages to a database.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Files: By the end of this class you should be able to: Prepare for EXAM 1. create an ASCII file describe the nature of an ASCII text Use and describe string.
PHP and SQL Server: Queries IST2101. Steps to Design PHP Pages to Answer User Queries 1.Query generation – What SQL query do we need to retrieve the desired.
PHP Error Handling & Reporting. Error Handling Never allow a default error message or error number returned by the mysql_error() and mysql_errno() functions.
Database Access Control IST2101. Why Implementing User Authentication? Remove a lot of redundancies in duplicate inputs of database information – Your.
Setting up Dreamweaver to use your local WAMP testing Server
MySQL MySQL and PHP – interacting with a database.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
Higher Computing Science Coding the Web: HTML, JavaScript, PHP and MySQL.
(ITI310) By Eng. BASSEM ALSAID SESSIONS 10: Internet Information Services (IIS)
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
PHP Form Processing * referenced from
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
PHP and SQL Server: Connection IST 210: Organization of Data IST2101.
Introduction and Principles
Due Dec 9th simple CHAT with
>> PHP: HTML Integration
KFT1 Task 4 GETTING STARTED
Online Translation Service Capstone Design
PHP Programming Using Cloud 9 IDE.
Presentation transcript:

Application design – setting up

Get Organised! When building web applications, you usually end up with a lot of files! It is essential that you develop a system to organise these files that you are comfortable with and stick to it! Every task/project you build should have its own directory

Get Organised! An example directory structure for your workspace: All projects stored in one directory New directory for each project Directory to store common files

Include files A web application WILL utilise include files Not only PHP files but also XHTML snippets (header, footer etc) Advisable to store these files in their own directory within your project.

Configuration/Settings Web applications usually have some settings that need to be changed depending on the environment they are running in. eg: database credentials, file paths etc If we store all of this data in one file which we then include in our scripts, our application becomes much more portable

Configuration/Settings Example of a basic configuration file: // database credentials define('DB_HOST', 'mysqlsrv.dcs.bbk.ac.uk'); define('DB_NAME', 'my_dbname'); define('DB_USER', 'my_username'); define('DB_PASSWD', 'my_password'); // The path to the application define('APP_PATH','/home/username/public_www/w1'); // Set the timezone to avoid PHP warnings date_default_timezone_set('Europe/London');

READ ME! As a developer, you won’t always be responsible for deploying the application. Provide all the information that is required to get the application up and running. Databases that need to be created Directory permissions that need to be set. Location of the application configuration file! Do this in a plain text file saved as readme.txt in the application root directory

READ ME! Example of a readme.txt file: Super Cool PHP application -------------------------- Author: Your name (example@example.com) Before deploying… 1. make sure the “data” directory is writable. 2. Change values defined in “includes/config.php” to match current environment. 3. “users” database will be created by PHP if it does not exist. Or you can create it manually using the sql found in “includes/database_setup.sql”

Credit where credit is due! There are endless PHP scripts and applications freely available to download and use. You are encouraged to explore, modify and utilise these resources. BUT, You must always give credit to the original author Use comments in your source code Add a note to your readme.txt

Credit where credit is due! Giving credit for ‘borrowed’ code: /* Function to print a list of files in a specified directory. This function is based on code found on Joe Blogg’s website. It has been modified by me to produce valid XHTML. Ref: http://www.example.com/joe-bloggs/ */ function printDirectoryContents(‘./datastore') { // modified code }

Abstraction Our goal when writing PHP applications, is to create as much re-usable code as we can. We do this by breaking the application into micro tasks. One function that prints an XHTML list of the files stored in a directory A group of functions that each perform one of the tasks necessary to achieve our end result One function to retrieve a directory’s contents as an array One function to print an array as an XHTML list etc… 8 4

Setting up your workspace Exercise Hands On Exercise Setting up your workspace