ADVM420- Class #6 Web Design with PHP and MySQL Building a Dynamic Website: Using a database to store webcontent © Copyright 2003 Grant Macewan College.

Slides:



Advertisements
Similar presentations
Anatomy of a Web Page. Parts of a Web Page Title Bar Navigation Tool Bar Location Bar Header Graphic/Image Text Horizontal Rule Links.
Advertisements

Drupal Basics Part 3 Create a new page Main tabs menu Using the theme Agricultural Communications Services Integrated Media Training Sessions
Chapter 3 – Web Design Tables & Page Layout
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Nvu - How to Create Your Own Website From Start to Finish!Dr. Dawn Sherry & Dr. Barry J. Monk Dr. Dawn Sherry Dr. Barry J. Monk Assistant Professor of.
Building Department Websites William McKeown
Build Your Teacher Web Page
Pasewark & Pasewark 1 Word Lesson 7 Working with Documents Microsoft Office 2007: Introductory.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Word Lesson 7 Working with Documents
Introducing new web content management tools for Priority...
Chapter 1 Getting Started With Dreamweaver. Explore the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
A02 Creating my website NAME ______________. UNIT 2 – A02 – Creating my Website The purpose of this assessment objective is to create 5 web pages containing.
WEB DESIGNING Prof. Jesse A. Role Ph. D TM UEAB 2010.
Wordpress Tutorial 22 – 24 April Table of Contents Introduction Designing blog Writing and Publishing blog Pages Posts Categories Tags Links Comments.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
The basics of the Online Portal
Getting Started with Dreamweaver
1 Web Developer Foundations: Using XHTML Chapter 11 Web Page Promotion Concepts.
Adobe Dreamweaver CS3 Revealed CHAPTER ONE: GETTING STARTED WITH DREAMWEAVER.
A guide for UICET for using Wikispaces.  A wiki is a web page or collection of web pages that can be linked together as a website.  Wikis are often.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:MG Information Systems :. © Martina Cesalova, 2005 MS FRONTPAGE 1 1.Open FrontPage – View -> Page 2.Open.
Website Design CLA – Transportation. Defining a Site Select: Site – New - Site Click Next.
Creating an Expression Web Site
Simple Pages for Omeka Lauren Dzura LIS
Web Technologies Website Development Trade & Industrial Education
Creating Effective School and PTA Websites Sam Farnsworth Utah PTA Technology Specialist
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Updating the School Website St George’s C of E (V.A.) Primary School.
How to Web Page with iModules First row of icons.
MKTG 476 FRONTPAGE II Lars Perner, Instructor 1 FrontPage II File structure and references File structure and references Editing standard HTML files Editing.
Adding Content to the Agency Web Site - Part 2. Adding individual web pages for success stories Agency Web Site Adding Content 2, Slide 2Copyright © 2004,
Website Development with Dreamweaver
Macromedia Dreamweaver 8 Revealed DREAMWEAVER GETTING STARTED WITH.
INDIANAUNIVERSITYINDIANAUNIVERSITY OneStart page types  Tab – pages across the top, immutable  Section – pages down the left  Subsection – pages under.
MS FrontPage 1: Developing a web site for the Sunny Morning Products Yong Choi CSU Bakersfield.
Language Club KompoZer Design View. Files you will need  Images  pages  Templates  Text.
Key Applications Module Lesson 21 — Access Essentials
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. word 2010 Chapter 3 Formatting Documents.
Nika Kasradze INF240 Project 1: Personal website.
Website Editing From Gingerweb The Image Gallery.
Porting methodology Porting of an WEB Site using PTK To insert your company logo on this slide From the Insert Menu Select “Picture” Locate your logo file.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:MG Information Systems :. © Martina Cesalova, 2005 MS FRONTPAGE 2 1.Create a new document 2.Save as L/bsba/IS330/yourfolder,
How To Design Your Own Webpage Created Especially For You By: Amanda E. Stricklin.
We Are Learning To (WALT): To create a working homepage for our websites What I am Looking For (WILF): A completed homepage containing a working navigation.
Chapter 1 Getting Started With Dreamweaver. Exploring the Dreamweaver Workspace The Dreamweaver workspace is where you can find all the tools to create.
NMD202 Web Scripting Week5. What we will cover today PHP & MySQL Displaying Dynamic Pages Exercises Modifying Data PHP Exercises Assignment 1.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
The Basics of Managing Your Department Website March 8, 2012.
Web Site Development - Process of planning and creating a website.
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
1 Creating a Menu Bar on a Secondary Web Page  It is important for visitors to be able to move easily from one page to another  You will create a menu.
Before We Begin Please download the files from as we will be using them in our walkthroughs.
EKTRON QUICK START GUIDEEKTRON QUICK START GUIDE Version 1.0 Copyright 2013 WebSolutions Technology, Inc. Fuller June 7, 2013.
COMP 143 Web Development with Adobe Dreamweaver CC.
Getting Started with Dreamweaver
Intro to WordPress (Using XAMPP)
Web Page Elements Writing For the Web
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
LMEvents SharePoint Portal How-to Guide
Project date 20/09/2007 PROJECT TITLE/07 01.
بسم الله الرحمن الرحيم.
Getting Started with Dreamweaver
Common Page Design Elements
Making a website.
A02 Creating my website NAME ______________.
Presentation transcript:

ADVM420- Class #6 Web Design with PHP and MySQL Building a Dynamic Website: Using a database to store webcontent © Copyright 2003 Grant Macewan College Russel Krause -

The Big Picture We now have many scripts that could be put together in a website Definition: A website is a collection of webpages with a common navigation system and purpose

A Page is a set of Panels…

Deconstructing a Web Page Consider a Webpage to consist of several panels: Top banner LeftContentRight Navbar Navbar Footer Each panel can contain an dynamic component The border is often consistent

Another way to look at it… A Table with 5 cells Cell #1 Cell #4 Cell #3 Cell #2 Cell #5

Components of a Web Page A Webpage consists of: Title META tags: Keywords, Description Stylesheet Header (1) Left Nav (2), Content (3), Right Nav (4) Footer (5) Perhaps we could store this information in a database table and render it dynamically?

Create tblPages…

Populate tblPages with some test data:

Creating the Portal Website We will modify template.html to become a framework for our interactive data panels of our community portal website Create a new directory called “portal” Save template.html as “portal/index.php” Copy config.php to “portal/config.php” Modify config.php to have your connection info

Add this at the top of index.php: Connect to the Database, open recordset to select the page requested… <?PHP include_once "myConfig.php"; $pg = $_REQUEST['Page']; if (!$pg) $pg = 1; //default to homepage //open the connection $conn = OpenConnection(); //Open the Page table... $sql = "SELECT * FROM tblPages WHERE (int_Page_ID=".$pg.") ORDER BY int_Page_ID"; $rst = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($rst, MYSQL_ASSOC) or die ("Page not found!"); ?>

Add this at the bottom of index.php: Disconnect from the Database… <?PHP // Free resultset, close connection mysql_free_result($rst); mysql_close($conn); ?>

of index.php Show Page fields from the Database… <META name=Keywords content=" "> <META name=Description content=" "> “ type="text/css">

of index.php Include Page panels from Database…

First Panel: right.inc left.inc builds a list of top level navigation… <?PHP function RenderLeftPanel() { $sql = "SELECT * FROM tblPages WHERE (int_Parent_ID IN (0,1)) ORDER BY int_Page_ID"; $rst = mysql_query($sql); while ($row=mysql_fetch_array($rst, MYSQL_ASSOC)) { print "<a href='home.php?Page=". $row['int_Page_ID']. "' title='". $row['mem_Description']."'>". $row['txt_Label']. " \n"; } mysql_free_result($rst); } RenderLeftPanel(); ?>

Next Panel: right.inc Create a Context Menu: Copy and modify left.inc to show only those pages that have ?Page=XX as a parent – save as right.inc

Adding Content to the Site What kind of information makes up the “content” of a website? If you think about it, much of it could be handled by the following few fields… Topic title Category Date Author Description Picture Hyperlink Let’s add some content to our site that I have prepared in this format… Download tblContents.sql from the website Paste the contents of this file into the “SQL” box of phpMyAdmin and click “Go”…

Pasting a SQL export back into phpMyAdmin…

Content Presentation Panel(s) Although all Content is stored in the database in the same table, this does not necessarily mean that all has to be presented in the same fashion. Consider making several Panels: News (past 30 days) Events (Future only) Links (only title, hyperlink, picture)

Content Upload Panel Perhaps you want to allow your visitors to upload their own links, news & information? Create a form and a script for the Content table to accept new data. Integrate this form and form processing script into your website

The rest of the site… Other panels can be made similarly Examples: News in a particular category Events in the future Hyperlinks to other sites Advertising … The sky’s the limit…