Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS

Slides:



Advertisements
Similar presentations
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Advertisements

PHP Conditions MIS 3501, Fall 2014 Jeremy Shafer Department of MIS Fox School of Business Temple University September 11, 2014.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Class06 Conditional Statements MIS 3501, Fall 2015 Brad Greenwood, PhD MBA Department of MIS Fox School of Business Temple University 9/10/2015 © 2014,
Course Introduction MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/12/2016.
Class03 Introduction to Web Development (Hierarchy and the IDE) MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University.
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.
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.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
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.
Class02 Introduction to web development concepts MIS 3501, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/14/2016.
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.
Course Introduction MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 8/30/2016.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
PDO Database Connections
Class03 Introduction to Web Development (Hierarchy and the IDE)
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
CHAPTER 4 DECISIONS & LOOPS
Organize your code with MVC
Introduction to web development concepts
Introduction to Web Development (Part 2)
Course Introduction MIS 3501 Jeremy Shafer Department of MIS
Course Introduction MIS 3501 Jeremy Shafer Department of MIS
Class06 Arrays MIS 3502 Jeremy Shafer Department of MIS
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
Introduction to JavaScript
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
A second look at JavaScript
Course Introduction 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
Class05 How to get data from a form
MySQL Backup, Transfer and Restore
PDO Revisited MIS 3502 Jeremy Shafer Department of MIS
Sending a text message (and more)
Form Validation, Part 2 (with jQuery, HTML5, and CSS)
Sessions and cookies MIS 3501 Jeremy Shafer Department of MIS
An Introduction to JavaScript
Programming Control Structures with JavaScript Part 2
Class11 Introduction to relational databases and MySQL
Loops and Arrays in JavaScript
Form Data (part 1) MIS3501 Jeremy Shafer Department of MIS
Introduction to JavaScript
An introduction to jQuery
Introduction to MIS3502 MIS 3502 Jeremy Shafer Department of MIS
MVC – Model View Controller
PDO and Arrays MIS 3502 Jeremy Shafer Department of MIS
Programming Control Structures with JavaScript
An introduction to jQuery
Sending a text message (and more)
Presentation transcript:

Class07 PHP: loops MIS 3501 Jeremy Shafer Department of MIS Fox School of Business Temple University

Course Overview We are here... MySQL To do: 2 Weeks We are here... 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)

What have we learned so far? PHP code runs on the server PHP code is embedded in HTML PHP has a filter_input function that can be used to retrieve data from form posts Like any other programming language, PHP lets us store data in variables Our PHP code can take different actions based on conditional statements

Conditional Statements

A little review…

A little review… (2)

A little review… (3)

Some more advanced conditional statements Lookie here! – Notice how we are considering three conditions in one statement. This condition reads: “if investment is empty OR investment is not numeric OR investment is less than or equal to 0 THEN …

Some more advanced conditional statements(2) Notice also that if statements can be nested inside each other. Here, the “if years greater than one” condition is nested inside the else block of the first condition. Whew!

This error message was created using a conditional statement. (Error trapping is just one use of conditional statements.)

(Doing the same thing over and over again) Loops (Doing the same thing over and over again)

A loop that stores the numbers 1 through 5 in a string

A more challenging question… Multiples of 3 and 5 If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.Find the sum of all the multiples of 3 or 5 below 1000. Discuss How would we solve this problem? Can you write a solution using pseudo-code? https://projecteuler.net/problem=1

Let’s try it…