770 likes | 877 Views
Creating Dynamic Database-Driven Sites with Dreamweaver. ASP PHP JSP ColdFusion. Lloyd Rieber. Workshop Home Page: http://projects.coe.uga.edu/workshop/rieber/. Last updated on November 20, 2008. Recommended: Get and Install the Dreamweaver Extension 'Go To Detail Extension for PHP'.
E N D
Creating Dynamic Database-Driven Sites with Dreamweaver ASP PHP JSP ColdFusion Lloyd Rieber Workshop Home Page: http://projects.coe.uga.edu/workshop/rieber/ Last updated on November 20, 2008
Recommended: Get and Install the Dreamweaver Extension'Go To Detail Extension for PHP' • Here’s the URL:http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=627434(Link is on workshop home page.)
Workshop Agenda • Welcome and introductions • Seeing the power of a dynamic web site in education • Online Introduction to Instructional Design • Seeing/doing it: Building a small dynamic “people” web site • List current people, add new person, update existing person • Advanced topics • Session variables, PHP scripting, Automated Email
Some of Lloyd’s Examples of Using Online Databases • Online Introduction to Instructional Design • Other examples • Project Promote • Peer Financial Counseling • WWILD Team • Introduction to Computers in Education (Online Course) • EDIT 6170 IDA Library • IDD Portfolio Management
Program Flowchart list.php update.php insert.php Update Record Insert Record update_record_reply.htm new_record_reply.htm
Client/Server Interaction for PHP Files Server Server locates the PHP file on the hard drive and parses it, removing all PHP script and replacing it with HTML text Client Client requests PHP File Server returns HTML text to client Adapted from Mitchell & Atkinson (2000)
How Databases Work A 15-Minute Primer
Relational Database StructureA Collection of Databases (tables) that connect (relate) to each other
Working with mySQL DatabasesphpMyAdmin http://projects.coe.uga.edu/pma
Getting Ready to Work with Dreamweaver Step 1: Make a root folder Step 2: Create a folder inside it named: yourLastname
Launch Dreamweaver Step 3: Launch Dreamweaver and define a new site that points to the root folder.
Remote Server Information Password: (this will be changed within a few days) eu3$@93! Be sure to “Test” your connection before proceeding. Notice that this server needs a Secure FTP connection.
Testing Server Information Be sure to “Test” your connection before proceeding. Double-check that this URL is correct. (On some servers, you will need to remove server-side pathways, such as “wwwroot”, from the URL Prefix.
Make a new file called “list.php” Add a 2 X 4 table and format accordingly:
Creating a Data Connection Go to the Application Panel, click on “Databases” tab, then follow the directions… Naming convention: connDescriptive Use “connLastName” (for reasons I’ll explain)
Creating a Data Connection Notice that a folder titled “Connections” has been automatically created in your root folder.
Creating a New RecordSet Go to the Application Panel, click on “Bindings” tab, then follow the directions… Always testing the connection is a good habit to develop Naming convention: rsDescriptive Use “rsPeople”
Repeating a Region with Multiple Data Step 1: Select table row <tr> as the region to repeat. (Repeat Region is always linked to a specific HTML tag.) Step 2: Select “Repeat Region” from Server Behaviors.
Upload and Test the Page Choose to “include dependent files” (only necessary the first time you upload). Reason: The “Connections” file needs uploaded too. http://projects.coe.uga.edu/workshop/rieber/list.php Your last name goes here
Create a New Document…insert.php • Select from menubar… • Insert • Data Objects > • Insert Record > • Record Insertion Form Wizard
Filling out the Dialog Box Remove from list
Create “new_record_reply.html” Click here to view all the records.
Reminder: Get Extension 'Go To Detail Extension for PHP' • Here’s the URL:http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=627434(Link is on workshop home page.)
What If I Didn’t Get the Extension? • Then you will have to enter the code manually: Generic: filename.php?recordID=<?php echo $row_recordsetName['fieldName']; ?> Actual for the example to follow: update.php?ID_people=<?php echo $row_rsPeople['ID_people']; ?>
Go to Detail Page Highlight the text “update”, then choose to “Go to Detail Page” (in Server Behaviors) Be sure that “ID_people” data will be passed as a URL parameter.
Create “update.php” page Click on “Bindings” tab, then choose to create a new recordset by clicking on + symbol and selecting “Recordset (Query). The “filter” must match the data being passed from the previous slide:
Record Update Form • Select from menubar… • Insert • Data Objects > • Update Record > • Record Update Form Wizard
Complete Dialog Box Remove from list
Create the Reply page update_record_reply.htm Be sure to include a link back to “list.php”
Upload and Test the Page Notice the data appended to the end of the URL