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

Slides:



Advertisements
Similar presentations
Murach’s C# 2010, C6 © 2010, Mike Murach & Associates, Inc.Slide 1.
Advertisements

Murach’s C# 2010, C3 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C3© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's C# 2012, C3© 2013, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C2© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's MySQL, C2© 2012, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C2© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach’s C# 2010, C1© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's MySQL, C1 © 2012, Mike Murach & Associates, Inc. Slide 1.
© 2013, Mike Murach & Associates, Inc.
Murach’s C# 2010, C4 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach’s C# 2010, C4 © 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C4© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's C , C4 © 2009, Mike Murach & Associates, Inc. Slide 1 © 2009, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C4© 2010, Mike Murach & Associates, Inc.Slide 1.
Murach's PHP and MySQL, C4© 2010, Mike Murach & Associates, Inc.Slide 1.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
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.
Class03 Introduction to Web Development with PHP MIS 3501, Fall 2015 Brad Greenwood, PhD MBA Department of MIS Fox School of Business Temple University.
Class02 Introduction to web development with PHP MIS 3501, Fall 2015 Brad N Greenwood Department of MIS Fox School of Business Temple University 8/27/2015.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
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,
Class03 Introduction to Web Development (Hierarchy and the IDE) MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
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.
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
PDO Database Connections
© 2010, Mike Murach & Associates, Inc.
Brad N Greenwood, PhD MBA
Form Data (part 2) MIS 3502, Fall 2015 Jeremy Shafer Department of MIS
Organize your code with MVC
PHP: includes MIS 3501 Jeremy Shafer Department of MIS
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
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
Form Data (part 2) MIS 3501 Jeremy Shafer Department of MIS
PDO Database Connections
Organize your code with MVC
© 2010, Mike Murach & Associates, Inc.
Introduction to relational databases and MySQL
PDO Database Connections
© 2015, Mike Murach & Associates, Inc.
© 2015, Mike Murach & Associates, Inc.
© 2015, Mike Murach & Associates, Inc.
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
Class11 Introduction to relational databases and MySQL
Form Data (part 1) MIS3501 Jeremy Shafer Department of MIS
© 2015, Mike Murach & Associates, Inc.
© 2015, Mike Murach & Associates, Inc.
© 2010, Mike Murach & Associates, Inc.
Murach's JavaScript and jQuery (3rd Ed.)
Murach's JavaScript and jQuery (3rd Ed.)
Presentation transcript:

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

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

Objectives (this class and next) © 2014, Mike Murach & Associates, Inc. Slide 3 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

Warm up – some things we’ve seen before… © 2014, Mike Murach & Associates, Inc. Slide 4

© 2010, Mike Murach & Associates, Inc. Slide 5 Murach's PHP and MySQL, C7

© 2010, Mike Murach & Associates, Inc. Slide 6 Murach's PHP and MySQL, C7

Radio buttons © 2014, Mike Murach & Associates, Inc. Slide 7

© 2010, Mike Murach & Associates, Inc. Slide 8 Murach's PHP and MySQL, C7 Notice how the name ‘card_type’ has been used here. The same name was used three times. Why?? When we have a collection of form elements that are logically grouped together, we may used a tag. Putting the input tags inside of does this and results in forms that are more intuitive to use.

© 2010, Mike Murach & Associates, Inc. Slide 9 Murach's PHP and MySQL, C7

Check Boxes © 2014, Mike Murach & Associates, Inc. Slide 10

© 2010, Mike Murach & Associates, Inc. Slide 11 Murach's PHP and MySQL, C7 Notice that here, the names are different. We need a way of distinguishing one next box from another. Next class, we’ll look at an alternate approach to dealing with multiple check boxes…c

Text Areas © 2014, Mike Murach & Associates, Inc. 12 Hear ye, Hear ye …

© 2010, Mike Murach & Associates, Inc. Slide 13 Murach's PHP and MySQL, C7 Note the use of “rows” and “cols” here.

© 2010, Mike Murach & Associates, Inc. Slide 14 Murach's PHP and MySQL, C7

© 2010, Mike Murach & Associates, Inc. Slide 15 Murach's PHP and MySQL, C7 Free text input is unpredictable! It is advisable to clear it up with the htmlspecialchars function.

nl2br © 2010, Mike Murach & Associates, Inc. Slide 16 Murach's PHP and MySQL, C7 Users are also prone to put line breaks (that is, carriage returns) in text areas. If you want to translate those line breaks to HTML break tags… PHP has a function for that exact purpose. The name nl2br means…. New Line 2 Break. Isn’t that way 2 cool?

© 2010, Mike Murach & Associates, Inc. Slide 17 Murach's PHP and MySQL, C7

Game Time… © 2014, Mike Murach & Associates, Inc. Slide 18