Creating Databases for Web Applications State capitals quiz Classwork: design a new quiz Homework: Make sure you can upload files and have MySQL database.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

What are the features of Moodle? Do NOT view this PowerPoint as a show. You need to be able to read the notes down below.
Welcome to Moodle! Moodle is an open source web application used to create interactive online learning sites. ITIS Corni – Modena, Italy.
Programming games Classwork: Show Favorite Sites. Show coin toss. Review concepts. Crooked coin toss. Homework: Complete coin toss examples. Upload files.
For the ultimate in entertainment, play with 2 or more people, individually or as a team Players alternate turns Each player picks an “answer” and must.
Assignment: Improving search rank – search engine optimization Read the following post carefully.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Creating Databases applications for the Web Reprise. Basic HTML review, forms Preview: Server side vs client side Classwork: create HTML forms and check.
Grade Scale Test 1 Results: Average class score after partial credit: __________ Commonly missed questions: #_________________ If you got less than 70%
Creating Databases SELECT. UPDATE. Demonstrate projects. Classwork / Homework: Prepare to choose teams & projects.
Creating Databases for Web Applications Posting due by next class on project! Lab: using files & work session Class: asp Application object 3-tier, separating.
Institute of New Media Development & Research Prabhat Road, Lane No 5, Opp. Lijit Papad, Above OBC Bank, 1st Floor, Pune Web site :
PHP : Hypertext Preprocessor
Week 4  Using PHP with HTML forms  Form Validation  Create your own Contact form Please Visit:
ITD 3194 Web Application Development Chapter 4: Web Programming Language.
Homework for October 2011 Nikolay Kostov Telerik Corporation
CSC 386 – Computer Security Scott Heggen. Database Security How can we minimize the probability of success by attacks like the one shown in the comic?
INTERNET APPLICATION DEVELOPMENT For More visit:
Creating databases for web applications SQL. Systems design. ER diagrams. Data flow diagrams. Storyboards. Homework: Plan database and applications for.
Creating databases for web applications Play quizzes Testing process regular expressions: form validation PHP coding handling forms Homework: regular expressions.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Creating Databases Uploading Files. Reading & writing files. Homework: Starting planning ‘original’ project.
Creating Databases for Web Applications Library diagrams Continue with diagrams for video clip archive and for (Flash) grid design. General and specific.
PHP meets MySQL.
Database Chess A server-based web gaming application by Jordan Arnold.
Programming Games Show your simple video. More video examples. Audio. Classwork/Homework: Produce more complex video program.
Creating Databases for Web Applications cookie examples lab time: favorites cookies & Sessions class time for group work/questions on projects Next class:
Go to your school’s web locker site school name.schoolweblockers.com) Your user name is the first letter of your first name, the first four.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Envision Math Online Edition.
Edmodo 101. Home Screen Your profile Action Tabs Calendar, tools and app$ Your Groups Search Box.
HTML Forms. Today’s Lecture We will try to understand the utility of forms on Web pages We will find out about the various components that are used in.
Programming games Examples. Classwork: work and show something of your final project. Homework: (finish…)
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
Overview: 1. Discussion of the basic architecture of a web application. 2. Discussion of the relevance of using MySQL and PHP in a web application.
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.
Creating databases for Web Applications php basics. ing. phpMyAdmin to set up MySQL. Homework: Use phpMyAdmin. Make posting with [unique] source on.
Synthesis ENGR 1181 MATLAB 11. Topics  No new material  Covers topics that will be on the Midterm 2 Exam MATLAB 01 – Program Design MATLAB 02 – Introduction.
Web Technology Introduction to PHP. PHP PHP stands for PHP Hypertext Preprocessor PHP is a Server-Side Web Scripting language, which executes on the web.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
SSI “Server Side Includes” SSI defined Server Side Includes (SSI) are HTML comment tags which contain commands directed at the Web server. The server.
Welcome To MOODLE Getting Started. Introductions Christa McLaughlin – High School math teacher and high school lead teacher of technology Jason Grubbs.
1 Final Review. 2 Final Exam  30% of your grade for the course  December 9 at 7:00 p.m., the regular class time  No makeup exam or alternate times.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
1 Project 3 The Kumquat Society Conference. 2 Conference Registration In this project you will write a program to handle a conference registration. The.
Moodle for Your Noodle. What in the world is Moodle? An open source Content Management System (or Course Management System) built around a sound educational.
U:/msu/course/cse/103 Day 21, Slide 1 CSE 103 Makeups –If you didn’t take one over the weekend, take one TUESDAY or WEDNESDAY!
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Creating Databases for Web applications SQL. XML. Linked Lists. NoSQL. Homework: Keep working on projects. Post constructive feedback on other projects.
Creating Databases for Web Applications 3-Tier. Design vs Function vs Content. More SQL. More php. Homework: work on final projects.
Introduction to PHP Brendan Knight. What is PHP PHP is a general-purpose scripting language originally designed for web development to produce dynamic.
Creating Databases for Web Applications State capitals quiz: demonstrates parallel structures AND multi-purpose php files Classwork: design a new quiz.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
Creating Databases applications for the Web: week 2 Basic HTML review, forms HW: Identify unique source for asp, php, Open Source, MySql, Access.
PHP Form Processing * referenced from
Database to HTML and Back again A programmers tale.
Creating interfaces Multi-language example Definition of computer information system VoiceXML example Project proposal presentations Homework: Post proposal,
Creating your course on MOODLE Learning Management System.
Creating Databases for Web applications Making a table of table information. Reprise on database design. SQL. Classwork/Homework: Projects! Postings.
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
Homework Drop Box on eChalk.  Step 1 – Create Homework Assignment  Step 2 - Students Submit Homework Assignments  Step 3 - Teacher Reviews Homework.
Creating Databases for Web applications
Creating Databases for Web Applications
Using the HTML and CSS Validation Services
Performance and User Experience Improvements to the ASU/NASA Space Grant Website
Creating Databases for Web Applications
Today’s Objectives Week 12 Announcements ASP.NET
ProgressBook for Parents
Presentation transcript:

Creating Databases for Web Applications State capitals quiz Classwork: design a new quiz Homework: Make sure you can upload files and have MySQL database. Get a simple quiz working like the state capital quiz. Post unique source on REGULAR expressions.

News Added a new General Discussion forum. Use this for questions, comments, news. –the News forum is intended to be just from the teacher! Use the General Discussion forum for 1 of the 2 homework assignments for today!

State capital quiz b/statecapquizask.phphttp://newmedia.purchase.edu/~Jeanine/d b/statecapquizask.php Choose what to be asked –Note: how can this be worded better???? Ask Check the answer –Give chance to try again or –Go back to get new question

State capitals quiz Implementation: three php files. Two of the php files call themselves and include the other file. –statecapitals.php This file is include[d] in the others. It sets up 2 parallel arrays holding the names of the states and the capital cities. –statecapquizask.php This is a multi-purpose file. –statecapquizcheck.php This is also a multi-purpose file. Checks answer. Allows for another guess or goes back to statecapquizask.php

State capitals storyboard statecapquiz.php statecapquizcheck.php Include file: statecapitals.php

Programming practices Parallel structures, in this case the array of states corresponding to the array of capitals, is a common programming device. Think of it as an alternative to a database or xml for simple cases. Self-referencing of php scripts is a common practice (mentioned last class) –benefits: reduces number of files. Information in one place –negatives: the one file is more complex

Materials Go to [our] moodle site: –sign in and go to the class. –go to Code Examples –click on StateCapitalQuiz NOTE: using View source on the browser does not show the whole php file!

statecapitals.php <?php $states = Array(); $capitals = Array(); $states[]="Alabama"; $capitals[]="Montgomery"; $states[]="Alaska"; $capitals[]="Juneau"; …

statecapquizask.php State capitals quiz: check State Capital Quiz <?php if ($saywhich){ include("statecapitals.php"); $which=$_GET['which']; $choice=rand(0, sizeOf($states)-1);

if ($which=='state') { $state = $states[$choice]; print("What is the capital of $state? "); print(" \n"); print(" "); print(" \n"); }

else { $capital = $capitals[$choice]; print("$capital is the capital of which state? "); print(" \n"); print(" "); print(" \n"); }

else { print("Choose form of question: do you want to be given the state or the capital? "); print(" \n"); print("Ask State"); print(" Capital\n"); print(" \n"); print(" "); print(" "); } ?>

statecapquizcheck.php State capitals quiz: check <?php include('statecapitals.php'); $choice=$_GET['choice']; $state=$_GET['state']; $capital=$_GET['capital']; $which=$_GET['which']; $correctstate=$states[$choice]; $correctcapital=$capitals[$choice];

if ($which=='state') { if ($capital == $correctcapital) { print("Correct! $correctcapital is the capital of $correctstate!"); print(" Play again "); }

else { print("WRONG! \n"); print(" New turn \n"); print("OR try again: What is the capital of $correctstate? "); print(" \n"); print(" "); print(" \n"); } }

else { if ($state == $correctstate) { print("Correct! The capital of $correctstate is $correctcapital!"); $saywhich='false'; print(" Play again "); }

else { print("WRONG! \n"); print(" New turn \n"); print("OR try again: $correctcapital is the capital of what state? "); print(" \n"); print(" "); print(" \n"); } } ?>

else { $capital = $capitals[$choice]; print("$capital is the capital of which state? "); print(" \n"); print(" "); print(" \n"); } }

else { print("Choose form of question: do you want to be given the state or the capital? "); print(" \n"); print("Ask State"); print(" Capital\n"); print(" \n"); print(" "); print(" "); } ?>

Reprise if statements within if statements php produces the appropriate html, including the form element The php is printing (producing) html. It is not operating the quiz! There are ways to enhance this program –perhaps limit the number of re-tries THIS WILL BE A HOMEWORK ASSIGNMENT!

Classwork (teams) Design simple quiz like the state capital quiz, using parallel arrays for questions and answers –Ideas? OR make significant enhancement to my quiz, like adding scoring, limiting re-tries OR some other quiz!

Homework Get your quiz working. Post link in posting to the General Discussion Forum. Research and post unique source on Regular expressions on the Links and sources forum. We use regular expressions to validate input and extract information from input.