Form Data (part 2) MIS 3502, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015 Slide 1.

Slides:



Advertisements
Similar presentations
1 Chapter 5 – Handling HTML Controls in Web Pages spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Advertisements

Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
USER INTERACTIONS: FORMS
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
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.
CST JavaScript Validating Form Data with JavaScript.
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.
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.
Brief Overview of Web Forms L. G. Piper Bunker Hill Community College 23 March 2011.
INTERNET APPLICATION DEVELOPMENT For More visit:
Lecture 6 – Form processing (Part 1) SFDV3011 – Advanced Web Development 1.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
PHP meets MySQL.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
HTML, PHP, and MySQL: Putting It All Together. Making a Form Input tags Types: “text” “radio” “checkboxes” “submit”
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
HTML Form and PHP IST Review of Previous Class HTML table and PHP array Winner is chosen randomly using rand() function.
CHAPTER 7 Form & PHP. Introduction All of the following examples in this section will require two web pages. The first page retrieves information posted.
Intro to Forms  HTML forms are used to gather information from end-users.  A form can contain elements like radio- buttons, text fields, checkboxes,
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Forms Overview, Query string, Submitting arrays, PHP & HTML, Input types, Redirecting the user Mario Peshev Technical Trainer Software.
Form Handling IDIA 618 Fall 2014 Bridget M. Blodgett.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Class11 Introduction to relational databases and MySQL MIS 3501, Fall 2015 Brad Greenwood, PhD MBA Department of MIS Fox School of Business Temple University.
Class06 Conditional Statements MIS 3501, Fall 2015 Brad Greenwood, PhD MBA Department of MIS Fox School of Business Temple University 9/10/2015 © 2014,
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Class02 More Arrays MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/14/2016.
Sessions and cookies (part 2) MIS 3501, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/19/2015.
Form Data (part 1) MIS 3502, Fall 2015 Brad Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015.
Introduction to AJAX MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/4/2016.
Class07 PHP: loops and includes MIS 3501, Fall 2015 Brad Greenwood, PhD MBA Department of MIS Fox School of Business Temple University 9/15/2015.
Class05 How to get data from a form MIS 3501, Fall 2015 Brad N Greenwood, PhD MBA Department of MIS Fox School of Business Temple University 9/8/2015.
HTML FORM. Form HTML Forms are used to select different kinds of user input. HTML forms are used to pass data to a server. A form can contain input elements.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Sessions and cookies MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 4/12/2016.
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
PDO Database Connections
Brad N Greenwood, PhD MBA
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
Organize your code with MVC
Arrays: Checkboxes and Textareas
PHP: includes MIS 3501 Jeremy Shafer Department of MIS
Sessions and cookies (part 2)
Form Data (part 1) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
Class07 PHP: loops and includes
PDO Database Connections
How to get data from a form
PDO Database Connections: Getting data out of the database
Web Systems Development (CSC-215)
PDO Database Connections: Getting data out of the database
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
PDO Database Connections
Organize your code with MVC
Introduction to relational databases and MySQL
Sessions and cookies (part 1)
PDO Database Connections
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS
Class08 Using the Documentation
Class05 How to get data from a form
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
Class11 Introduction to relational databases and MySQL
Form Data (part 1) MIS3501 Jeremy Shafer Department of MIS
Presentation transcript:

Form Data (part 2) MIS 3502, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015 Slide 1

MySQL Weeks 6 & 7 HTML & CSS Weeks 1 & 2 PHP Weeks 3 – 5 PDO Week 8 & 9 Course Overview To do: Organize your code with MVC (week 11) Work with forms (week 12) Use cookies and sessions (week 13) We are here. Slide 2

Objectives (this last class and this one) 1.Use text boxes, password boxes, radio buttons, check boxes, drop-down lists, list boxes, and text areas to get input from the user. 2.Use hidden fields to pass data to the web application when a form is submitted. 3.Use the htmlspecialchars and nl2br functions to display user entries the way you want them displayed. 4.Get this data in to (and out of) a database table Slide 3

Last time we looked at check boxes … Slide 4

Recall from last time… Slide 5

Slide 6 Another (new) approach to dealing with multiple check boxes is to assign them a common name, followed by a pair of square brackets.

Slide 7 When checkboxes are named in this way, the filter_input function can then be used to extract those selected values into an array. Like this… This option properly encodes the square brakets “[“ and “]” This option forces the output of the filter_input function to be an array,

OK… now what? We have an array of user provided data. Now what do we do with it? Presenting that data again, one element at a time, implies some sort of loop. The next slides illustrate two different approaches. One using foreach and the other using for, Slide 8 It’s time for a …

Looping through the array with foreach Slide 9 The => operator separates the key from the value in this array element. So $key gets “0” and $value gets “pep” when this loop iterates.

Looping through the array with a “for” loop Slide 10 You might find this approach easier to understand. It does, however, rely on a function that is new to you. The count function will return the number of elements in an array

Selection lists Slide 11

Slide 12 Notice that we use “selected” here. If this were a checkbox or radio button, we would have used “checked”.

Slide 13

Lets give it a try… Slide 14