Creating Databases applications for the Web Basic HTML review, forms Preview: Server side vs client side Flash HW: Review HTML forms and FLASH examples.

Slides:



Advertisements
Similar presentations
PHP Form and File Handling
Advertisements

JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
PHP I.
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?
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
The Web Warrior Guide to Web Design Technologies
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Video, audio, embed, iframe, HTML Form
JavaScript Forms Form Validation Cookies CGI Programs.
HTML Form Processing Learning Web Design – Chapter 9, pp Squirrel Book – Chapter 11, pp
Python and Web Programming
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Uploading Files. Why? By giving a user the option to upload a file you are creating an interactive page You can enable users have a greater web experience.
Creating Databases applications for the Web Reprise. Basic HTML review, forms Preview: Server side vs client side Classwork: create HTML forms and check.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
MS3304: Week 4 PHP & HTML Forms. Overview HTML Forms elements refresher Sending data to a script via an HTML form –The post vs. get methods –Name value.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
Application Development Description and exemplification of server-side scripting language for server connection, database selection, execution of SQL queries.
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.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Creating Databases for Web Applications Reprise: Systems design (diagrams) Flash to php Homework: Prepare for quiz.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Using Client-Side Scripts to Enhance Web Applications 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
CA Professional Web Site Development Class 2: Anatomy of a Web Site and Web Page & Intro to HTML.
Website Development with PHP and MySQL Saving Data.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
ITCS373: Internet Technology Lecture 5: More HTML.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Creating databases for Web Applications php basics. ing. phpMyAdmin to set up MySQL. Homework: Use phpMyAdmin. Make posting with [unique] source on.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
Creating Databases Local storage. join & split Classwork: show 1 table application. Share designs for oscars application. Adaptive select. Homework: [Catch.
Web App GUI: JSP Basics & Forms 3680 Enterprise Programming.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Introduction to JavaScript CS101 Introduction to Computing.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
XP Tutorial 8 Adding Interactivity with ActionScript.
Jan 2001C.Watters1 World Wide Web and E-Commerce Client Side Processing.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 7 - Introduction to Common Gateway Interface (CGI) Outline 7.1Introduction 7.2A Simple HTTP Transaction.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML Forms.
Since you’ll need a place for the user to enter a search query. Every form must have these basic components: – The submission type defined with the method.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
Creating Databases applications for the Web: week 2 Basic HTML review, forms HW: Identify unique source for asp, php, Open Source, MySql, Access.
XP Tutorial 8 Adding Interactivity with ActionScript.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
A little PHP. Enter the simple HTML code seen below.
Creating databases for Web Applications
Creating Databases applications for the Web
A little PHP.
How to Write Web Forms By Mimi Opkins.
Intro to PHP & Variables
Client side & Server side scripting
PHP Forms and Databases.
Presentation transcript:

Creating Databases applications for the Web Basic HTML review, forms Preview: Server side vs client side Flash HW: Review HTML forms and FLASH examples

Caution Chicken and egg problem: what to explain first Try some skipping ahead to motivate explanations.

Hypertext markup language Interpreted by browser on client Displays information Gathers information to send to server (PHP) –Most typical way: HTML form – element with extra information in query string (explained soon)

HTML review Ordinary text plus tags. Tags are singletons or pairs template for all html files:......

HTML examples My summer vacation Creating an html file requires attention to detail …

HTML Tables Used to display data from database! Often, [your] PHP code will generate the table tags: tr, td

HTML tags referencing files Continue

Reprise Information entered into form will be sent to the file indicated in the action attribute

Structure CLIENT Browser (Firefox): Requests URL SERVER PHP interpreter SERVER DBMS (MySQL) Build HTML page

Notes method=get produces the so-called query string. We can also generate query strings using php OR as direct call –Direct calls can be done for testing method=post sends data another way (via HTTP headers). Benefit is that less is revealed to user. Think of it also as lack of clutter. Older practice in PHP could refer to POST or GET or cookies or variables in the same way. Current suggested practice for PHP is to distinguish these. Alternative: action="mailto: address"

Query string Name = value pairs –Name is the name of the element –Value is what the person entering data into the form types in Query string will be URL?name1=value1&name2=value2… Blanks will be changed to +. May be other substitutions. –Special characters, including blanks can require special handling at php end.

First Name Last Name Choose one New Media Math/Computer science Other LAS Conservatories Continuing education placeholder

Script referred to by action The php file probably will contain html and code that produces html. –This is reason to know the tags. The php code will be inside special delimiters –REPEAT WARNING: tricky syntax. Much fussing about quotation marks. –more on this later.

After clicking send Browser goes to the file indicated by the action parameter The URL for this is the following (one long string, not split into multiple lines): file:///X|/accepts_data.htm?fname=J eanine&lname=Meyer&category=newmed ia

Second example: file:///X|/accepts_data.htm?fname=J ohn&lname=Smith&category=arts

One more example that doesn't do anything! Generate query string Coffee shop Coffee Hot Cocoa Chai Tall Grand Super Name:

Flash Timeline Actions Timeline can contain movie clip instances that have their own time line. –For example: Chasing Bo moves around Bo that [may] be animated by its own frame-by- frame animation

Flash events Mouse events Interface (for example, radio button) URL request completion event For all events, the setting of the handler is done using object.addEventListener(name of event, name of function to respond to event)

Flash The two Flash examples use php but not MySQL. They do need to be tested on the server! Demonstrate –Election –Catching Bo

Flash /Actionscript ActionScript 3.0 many facilities for obtaining information from user Send (invoke) other file using –URLRequest –URLVariables –URLLoader

Set up Flash objects var variables:URLVariables = new URLVariables(); var request:URLRequest = new URLRequest(); var loader:URLLoader = new URLLoader(); request.url = "change.php"; Equivalent to setting action in HTML

Passing information Defines any number of [programmer defined] properties of the variables object variables.who = …. Set the request object to use the variables object request.data = variables; Issue the request loader.load(request); Set up a listener to act when request is complete loader.addEventListener(Event.COMPLETE, completeWriting); Some function

Catching Bo Premise is that when player catches Bo, she/he can send a message to someone. Uses URLRequest and URLVariables objects –Defines.body,.to,.from,.subject properties of the variables object Doesn't use a URLLoader object Constructs message

ActionScript variables.body="I caught Bo on "+caught+ ". Visit "+gameURL; variables.to=toaddress.text; variables.subject="news"; variables.from = fromaddress.text; request.data = variables; request.method=URLRequestMethod.POST; sendToURL(request);

Cautions Need to be aware of where (client or server) code is executed And timing: some things are done immediately, and some need time to complete. –Chasing Bo: didn't need to wait for completion. –NOTE: did NOT check for success. Could have been a bad address.

Flash source If time: Examine code for Catching Bo Look at send .php NOTE: generally, cannot examine php source. Try – –The source you see is the HTML only.

<?php $to = $_POST['to']; $subject = $_POST['subject']; $body = $_POST['body']; $headers = "From: ". $_POST['from']; if (mail($to, $subject, $body,$headers)) { echo("Your message was sent"); } else { echo("There was a problem."); } /* the error messages will not appear if called from Flash application, but will appear if called from html */ ?>

Homework Write HTML script with a form with –several input elements –Use method=get –Use placeholder action=dummy.html –Submit element Test (there will be an error message since dummy.html does not exist!). Look at the query string generated Examine & build your own Flash example, for sending Catching Bo –Create and upload send .php. Create.fla file; Publish and upload.html and.swf files. Does not exist