Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS

Slides:



Advertisements
Similar presentations
Form Basics CS Web Data  Most interesting web pages revolve around data  examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes  can.
Advertisements

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.
Lecture 6 – Form processing (Part 1) SFDV3011 – Advanced Web Development 1.
HTML5 Forms Forms are used to capture user input …
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 2) MIS 3502, Fall 2015 Brad N Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/2015 Slide 1.
Form Data (part 1) MIS 3502, Fall 2015 Brad Greenwood, PhD Department of MIS Fox School of Business Temple University 11/10/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.
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.
Simple PHP Web Applications Server Environment
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Creating and Processing Web Forms
PDO Database Connections
Class03 Introduction to Web Development (Hierarchy and the IDE)
Chapter 5 Validating Form Data with JavaScript
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
Introduction to web development concepts
ITM 352 HTML Forms, Basic Form Processing
How to Write Web Forms By Mimi Opkins.
Objectives Design a form Create a form Create text fields
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Using the HTML and CSS Validation Services
Arrays: Checkboxes and Textareas
Class06 Arrays MIS 3502 Jeremy Shafer Department of MIS
PHP: includes MIS 3501 Jeremy Shafer Department of MIS
Sessions and cookies (part 2)
>> More on HTML Forms
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
Validation and Building Small Apps
Web Systems Development (CSC-215)
Arrays MIS 3502 Jeremy Shafer Department of MIS Fox School of Business
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
Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS
Class05 How to get data from a form
MySQL Backup, Transfer and Restore
Text Analyzer BIS1523 – Lecture 14.
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
Programming Control Structures with JavaScript Part 2
Class11 Introduction to relational databases and MySQL
Getting started with jQuery
An introduction to jQuery
Loops and Arrays in JavaScript
JavaScript objects, functions, and events
Form Data (part 1) MIS3501 Jeremy Shafer Department of MIS
An introduction to jQuery
Introduction to MIS3502 MIS 3502 Jeremy Shafer Department of MIS
MVC – Model View Controller
An introduction to jQuery
PHP-II.
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS Fox School of Business Temple University

Course Overview We are here!!! To do: MySQL 2 Weeks HTML & CSS 2 Weeks PHP 3 Weeks PDO 2 weeks To do: Organize your code with MVC (1 week) Work with forms (1 week) Use cookies and sessions (1 week)

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

Last time we looked at check boxes …

Recall from last time…

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

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? It’s time for a … 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.

Looping through the array with foreach 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 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

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

Making a selection list into a selection box:

Time for an experiment…