HTTP Parameters and Arrays

Slides:



Advertisements
Similar presentations
Introduction to PHP Dr. Charles Severance
Advertisements

PHP Functions / Modularity
What is it? –Large Web sites that support commercial use cannot be written by hand What you’re going to learn –How a Web server and a database can be used.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
Multiple Tiers in Action
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
Getting PHP Hosting Dr. Charles Severance. What We Need We want to be able to put up our application on the web so anyone can access our URL (and so we.
Forms and PHP Dr. Charles Severance
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
PHP Arrays Dr. Charles Severance
Conditional Execution Chapter 3 Python for Informatics: Exploring Information
Introduction to Dynamic Web Content Dr. Charles Severance
PHP Functions Dr. Charles Severance
Windows 7 WampServer 2.1 MySQL PHP 5.3 Script Apache Server User Record or Select Media Upload to Internet Return URL Forward URL Create.
How Web Database Architectures Work CPS181s April 8, 2003.
Forms and PHP Dr. Charles Severance
Display Page (HTML/CSS)
Relational Databases and MySQL Charles Severance
PHP Arrays Dr. Charles Severance
PHP Functions / Modularity Dr. Charles Severance
Loops and Iteration Chapter 5 Python for Informatics: Exploring Information
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.
XP Creating Web Pages with Microsoft Office
Introduction to Dynamic Web Content Dr. Charles Severance
PHP using MySQL Database for Web Development (part II)
Dr. Charles Severance Using Handlebars Dr. Charles Severance
Section 10.1 Define scripting
C.R.U.D. Charles Severance
Form Processing in PHP Dr. Charles Severance
Introduction to Dynamic Web Content
PHP Arrays Dr. Charles Severance
Our Technologies Dr. Charles Severance
Reading Files Chapter 7 Python for Everybody
Databases.
HTML Charles Severance
JavaScript Dr. Charles Severance
Introduction to Dynamic Web Programming
PHP Functions / Modularity
Transactions Dr. Charles Severance
Cascading Style Sheets
Getting PHP Hosting Dr. Charles Severance
Using JSON Dr. Charles Severance
Introduction and Principles
Redirect, Routing, and Authentication
Regular Expressions Chapter 11 Python for Everybody
Introduction to PHP Dr. Charles Severance
Relational Databases and MySQL
Loops and Iteration Chapter 5 Python for Everybody
Introduction to PHP Dr. Charles Severance
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Functions Chapter 4 Python for Everybody
PHP Arrays Dr. Charles Severance
Object Oriented Programming in JavaScript
PHP / MySQL Introduction
Expressions and Control Flow in PHP
Tuples Chapter 10 Python for Everybody
ISC440: Web Programming 2 Server-side Scripting PHP 3
PHP + Oracle = Data-Driven Websites
PHP Namespaces (in progress)
Introduction to Dynamic Web Content
Using jQuery Dr. Charles Severance
JavaScript Form Validation
Charles Severance Single Table SQL.
Globally interconnected 6lowPAN
Introduction to Dynamic Web Content
PHP Forms and Databases.
PHP an introduction.
Data Modelling Many to Many
Model View Controller (MVC)
Presentation transcript:

HTTP Parameters and Arrays

PHP Global Variables Part of the goal of PHP is to make interacting with HTTP and HTML as easy as possible PHP processes the incoming HTTP Request based on the protocol specifications and drops the data into various super global variables (usually arrays)

http://www.wa4e.com/code/arrays/get-01.php

Time D OM Apache MySql PHP ind.php RRC/HTTP SQL Browser Web Server Database Server D OM Apache static files MySql Parse Request Parse Response $_GET php code PHP ind.php JavaScript RRC/HTTP SQL

Validation Making sure all user data is present and the correct format before proceeding Non empty strlen($var) > 0 A number is_numeric($var) An email address strpos($var, '@') > 0 ....

http://www.wa4e.com/code/arrays/guess.php?guess=7

http://www.wa4e.com/code/arrays/guess.php?guess=200

Summary PHP arrays are a very powerful associative array as they can be indexed by integers like a list, or use keys to look values up like a hash map or dictionary PHP arrays maintain order and there are many options for sorting We can use explode() to split a string into an array of strings HTTP Information is pre-processed and placed in super global arrays

Acknowledgements / Contributions Continue new Contributors and Translators here These slides are Copyright 2010- Charles R. Severance (www.dr-chuck.com) as part of www.wa4e.com and made available under a Creative Commons Attribution 4.0 License. Please maintain this last slide in all copies of the document to comply with the attribution requirements of the license. If you make a change, feel free to add your name and organization to the list of contributors on this page as you republish the materials. Initial Development: Charles Severance, University of Michigan School of Information Insert new Contributors and Translators here including names and dates Note from Chuck. Please retain and maintain this page as you remix and republish these materials. Please add any of your own improvements or contributions.