CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

Size: px
Start display at page:

Download "CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus"

Transcription

1 CSCI-UA: Database Design & Web Implementation Professor Evan Sandhaus Lecture #18: PHP: The PHP Hypertext Preprocessor Database Design and Web Implementation

2 Database Design and Web Implementation 2

3 3 Database Design and Web Implementation

4 4 Database Design and Web Implementation

5 Administrivia Midterm - Couple of you don t have it Homework Homework 6 due 4/9/2013 Database Design and Web Implementation 5

6 On The Menu (re)introduction To PHP (re)introduction To HTML Forms HTML Forms + PHP = Awesome Sauce Return to SQL Queries (Time Permitting) Database Design and Web Implementation 6

7 PHP PHP = The PHP Hypertext Preprocessor Invented in 1995 Server Side Scripting Language (deets on next slide) Running on 244 Million Websites Evan Sandhaus is not a huge fan Database Design and Web Implementation 7

8 PHP - Server Side Scripting Language Database Design and Web Implementation 8

9 Up and running with PHP at NYU Create a PHP File Put in somewhere on i6 that is web-accessible. Make sure the file and directory are world executable chmod 755 <file dir> Access that PHP File in your browser Profit (not really) Gory Details: CSCI-UA /Php_on_i6_sp13.php Database Design and Web Implementation 9

10 PHP - Hello World <?php?> echo "Hello World!"; OR <?php?> print "Hello World!"; Database Design and Web Implementation 10

11 PHP - Variables // numbers $current_year = 2013; $pi = ; $distance_to_moon = 3.844e6; Database Design and Web Implementation 11

12 PHP - Variables // booleans $just_true = true; $just_false = false; $or_true = $just_true $just_false; // true $and_true = $just_true && $just_true; //true Database Design and Web Implementation 12

13 PHP - Variables // Strings $single_quotes = 'Single Lady'; $double_quotes = "By Beyonce"; // String Concatenation $concat = $single_quotes." ".$double_quotes; // "Single Lady By Beyonce" // String Formatting $formatted_string = "Welcome to $current_year!"; // "Welcome to 2013" $format_fail = 'Welcome to $current_year!'; // "Welcome to $current_year" $format_comma = 'Welcome to '.number_format($current_year); // "Weclome to 2,013" Database Design and Web Implementation 13

14 PHP - Arrays // Arrays // creates an empty array $simple_array = array(); // set position 0 to 1 $simple_array[0] = 1; // create an array with the specified values $simple_array = array( 1,2,3,5,7,11,13 ); // append 17 to the end of the array $simple_array[] = 17; // assign value 5 to $a_prime $a_prime = $simple_array[3]; // assign length of $simple_array (8) to $a_length $a_length = sizeof($simple_array); Database Design and Web Implementation 14

15 PHP - Dictionaries // Dictionaries - also arrays // but with keys that aren't sequential integers // create an empty array $simple_dictionary = array(); // assign value 'Engel' to key 'Deena' $simple_dictionary['deena'] = 'Engel'; // Inline dictionary declaration $simple_dictionary = array( 'Evan' => 'Sandhaus', 'Tara' => 'Bobiak' ); // Assigns 'Sandhaus' to $lname $lname = $simple_dictionary['evan']; // Assign "Mr. Sandhaus plans to mary Ms. Bobiak" // to $array_concat $array_concat = "Mr. {$simple_dictionary['evan']} plans to mary Ms. {$simple_dictionary['tara']}"; Database Design and Web Implementation 15

16 PHP Complex Dictionaries // assign all of the variables we've already // defined to one big array $complex_dictionary = array( 'current_year' => $current_year, 'pi' => $pi, 'distance_to_moon' => $distance_to_moon, 'just_true' => $just_true, 'just_false' => $just_false, 'or_true' => $or_true, 'and_true' => $and_true, 'single_quotes' => $single_quotes, 'double_quotes' => $double_quotes, 'concat' => $concat, 'formatted_string' => $formatted_string, 'format_fail' => $format_fail, 'format_comma' => $format_comma, 'simple_array' => $simple_array, 'a_prime' => $a_prime, 'a_length' => $a_length, 'array_concat' => $array_concat, 'simple_dictionary' => $simple_dictionary, 'lname' => $lname, ); Database Design and Web Implementation 16

17 Foreach Loops $simple_dictionary = array( 'Evan' => 'Sandhaus', 'Tara' => 'Bobiak' ); // Simple foreach loop // Prints out // Evan Sandhaus // Tara Bobiak foreach ($simple_dictionary as $key => $value) { echo "$key $value<br>"; } echo "<br>"; Database Design and Web Implementation 17

18 PHP Built-In Fuctions is_array(x), is_boolean(x), is_string(x) : True if x is of the specified type. implode(glue, array) create a string containing each of the elements from array separated by the 'glue' string. isset(array[key]): Returns true if key exists in array, false otherwise. sizeof(array), count(array): Return the size of an array. Database Design and Web Implementation 18

19 Foreach Loop And Conditionals // print out all of our example variables foreach ($complex_dictionary as $key => $value) { if (is_array($value)) { // if the value is an array format it nicely $array_string = '['.implode(', ', $value).']'; echo "<b>$key:</b><br>'$array_string'<br><br>"; } else if (is_string($value)) { // If the value is a string put quotes around it. echo "<b>$key:</b><br>'$value'<br><br>"; } else if (is_bool($value)) { // If the value is a boolean render it as // True or False $boolean_string = ($value)? 'True' : 'False'; echo "<b>$key:</b><br>$boolean_string<br><br>"; } } else { // If the value is anything else // just throw it in to the mix echo "<b>$key:</b><br>$value<br><br>"; } Database Design and Web Implementation 19

20 Example PHP In HTML Printout All of the Current Date and The Browser and the Remote Host $_SERVER['REMOTE_HOST'] $_SERVER['HTTP_USER_AGENT'] $date('y/m/d H:i:s'); Database Design and Web Implementation 20

21 HTML Form Review Lets Create a form for submitting a news article to a CMS. Fields Headline Byline Type of Material "News / Opinion" Bureau - Drop Down Article Database Design and Web Implementation 21

22 Form <form action="cms.php" method="post" > Database Design and Web Implementation 22

23 Inputs <input type="text" name='headline'/> <select name='issue'> <option value='winter'>winter</option> <option value='spring'>spring</option> <option value='summer'>summer</option> <option value='fall'>fall</option> </select> Database Design and Web Implementation 23

24 Inputs Continued <input type='radio' name='content_type' value='news'>news</input> <input type='radio' name='content_type' value='opinion'>opinion</input> <textarea rows="10" cols="60" name='article_body'></textarea> <input type="checkbox" name="tag[]" value="us">united States<br> <input type="checkbox" name="tag[]" value="world">world<br> <input type="checkbox" name="tag[]" value="sports">sports<br> <input type="checkbox" name="tag[]" value="entertainment">entertainment<br> Database Design and Web Implementation 24

25 Submit <input type="submit" value="submit"> Database Design and Web Implementation 25

26 Tying it all togeather <!DOCTYPE html> <html> <head> <title>fake CMS Form</title> </head> <body> <form name="cms_input" action="cms.php" method="post" class='pretty_form'> <p> Headline:<br> <input type="text" name='headline'/> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> Byline:<br> <input type="text" name='byline'/> Issue: <select name='issue'> <option value='winter'>winter</option> <option value='spring'>spring</option> <option value='summer'>summer</option> <option value='fall'>fall</option> </select> Content Type:<br> <input type='radio' name='content_type' value='news'>news</input> <input type='radio' name='content_type' value='opinion'>opinion</input> Article Text:<br> <textarea rows="10" cols="60" name='article_body'> </textarea> Tags:<br> <input type="checkbox" name="tag[]" value="us">united States<br> <input type="checkbox" name="tag[]" value="world">world<br> <input type="checkbox" name="tag[]" value="sports">sports<br > <input type="checkbox" name="tag[]" value="entertainment">entertainment<br> <p> </p> </form> </body> </html> <input type="submit" value="submit"> Database Design and Web Implementation 26

27 Database Design and Web Implementation 27

28 Query Me This How many tags are there of each type? How many authors are there of each type? Find the article with the most images? Find the article with the most tags? Find the most commonly applied tag? How many articles are authored by more than one author? How many articles are authored by organizations services? Database Design and Web Implementation 28

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #28: This is the end - the only end my friends. Database Design and Web Implementation

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #16: JOIN, SELECT, UPDATE DELETE Database Design and Web Implementation Database

More information

WEBD 236 Web Information Systems Programming

WEBD 236 Web Information Systems Programming WEBD 236 Web Information Systems Programming Week 4 Copyright 2013-2017 Todd Whittaker and Scott Sharkey (sharkesc@franklin.edu) Agenda This week s expected outcomes This week s topics This week s homework

More information

Basic PHP. Lecture 19. Robb T. Koether. Hampden-Sydney College. Mon, Feb 26, 2108

Basic PHP. Lecture 19. Robb T. Koether. Hampden-Sydney College. Mon, Feb 26, 2108 Basic PHP Lecture 19 Robb T. Koether Hampden-Sydney College Mon, Feb 26, 2108 Robb T. Koether (Hampden-Sydney College) Basic PHP Mon, Feb 26, 2108 1 / 27 1 PHP 2 The echo Statement 3 Variables 4 Operators

More information

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

CMPS 401 Survey of Programming Languages

CMPS 401 Survey of Programming Languages CMPS 401 Survey of Programming Languages Programming Assignment #4 PHP Language On the Ubuntu Operating System Write a PHP program (P4.php) and create a HTML (P4.html) page under the Ubuntu operating system.

More information

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web

The PHP language. Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Web programming The PHP language Our objective Teaching you everything about PHP? Not exactly Goal: teach you how to interact with a database via web Access data inserted by users into HTML forms Interact

More information

CS4604 Prakash Spring 2016! Project 3, HTML and PHP. By Sorour Amiri and Shamimul Hasan April 20 th, 2016

CS4604 Prakash Spring 2016! Project 3, HTML and PHP. By Sorour Amiri and Shamimul Hasan April 20 th, 2016 CS4604 Prakash Spring 2016! Project 3, HTML and PHP By Sorour Amiri and Shamimul Hasan April 20 th, 2016 Project 3 Outline 1. A nice web interface to your database. (HTML) 2. Connect to database, issue,

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus Lecture #17: MySQL Gets Done

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus  Lecture #17: MySQL Gets Done CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #17: MySQL Gets Done Database Design and Web Implementation Database Design and

More information

HTML Forms IT WS I - Lecture 11

HTML Forms IT WS I - Lecture 11 HTML Forms IT WS I - Lecture 11 Saurabh Barjatiya International Institute Of Information Technology, Hyderabad 04 October, 2009 Contents Seeing submitted values 1 Seeing submitted values 2 3 Seeing submitted

More information

B. V. Patel Institute of BMC & IT 2014

B. V. Patel Institute of BMC & IT 2014 Unit 1: Introduction Short Questions: 1. What are the rules for writing PHP code block? 2. Explain comments in your program. What is the purpose of comments in your program. 3. How to declare and use constants

More information

First Simple Interactive JSP example

First Simple Interactive JSP example Let s look at our first simple interactive JSP example named hellojsp.jsp. In his Hello User example, the HTML page takes a user name from a HTML form and sends a request to a JSP page, and JSP page generates

More information

HTML crashcourse. general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button

HTML crashcourse. general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button HTML crashcourse general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button Andreas Schmidt HTML Crash-Kurs 1/10 general structure

More information

HTML Forms. By Jaroslav Mohapl

HTML Forms. By Jaroslav Mohapl HTML Forms By Jaroslav Mohapl Abstract How to write an HTML form, create control buttons, a text input and a text area. How to input data from a list of items, a drop down list, and a list box. Simply

More information

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP

Course Topics. The Three-Tier Architecture. Example 1: Airline reservations. IT360: Applied Database Systems. Introduction to PHP Course Topics IT360: Applied Database Systems Introduction to PHP Database design Relational model SQL Normalization PHP MySQL Database administration Transaction Processing Data Storage and Indexing The

More information

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users

Let's Look Back. We talked about how to create a form in HTML. Forms are one way to interact with users Introduction to PHP Let's Look Back We talked about how to create a form in HTML Forms are one way to interact with users Users can enter information into forms which can be used by you (programmer) We

More information

Forms, CGI. Objectives

Forms, CGI. Objectives Forms, CGI Objectives The basics of HTML forms How form content is submitted GET, POST Elements that you can have in forms Responding to forms Common Gateway Interface (CGI) Later: Servlets Generation

More information

CPSC 481: CREATIVE INQUIRY TO WSBF

CPSC 481: CREATIVE INQUIRY TO WSBF CPSC 481: CREATIVE INQUIRY TO WSBF J. Yates Monteith, Fall 2013 Schedule HTML and CSS PHP HTML Hypertext Markup Language Markup Language. Does not execute any computation. Marks up text. Decorates it.

More information

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB Unit 8 HTML Forms and Basic CGI Slides based on course material SFU Icons their respective owners 1 Learning Objectives In this unit you will

More information

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems Database Programming in PHP Li Xiong Department of Mathematics and Computer Science Emory University Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP

More information

What is PHP? [1] Figure 1 [1]

What is PHP? [1] Figure 1 [1] PHP What is PHP? [1] PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open source scripting language PHP scripts are executed on the server PHP is free to download and use Figure

More information

Lecture 12. PHP. cp476 PHP

Lecture 12. PHP. cp476 PHP Lecture 12. PHP 1. Origins of PHP 2. Overview of PHP 3. General Syntactic Characteristics 4. Primitives, Operations, and Expressions 5. Control Statements 6. Arrays 7. User-Defined Functions 8. Objects

More information

PHP 5 if...else...elseif Statements

PHP 5 if...else...elseif Statements PHP 5 if...else...elseif Statements Conditional statements are used to perform different actions based on different conditions. PHP Conditional Statements Very often when you write code, you want to perform

More information

Course Topics. IT360: Applied Database Systems. Introduction to PHP

Course Topics. IT360: Applied Database Systems. Introduction to PHP IT360: Applied Database Systems Introduction to PHP Chapter 1 and Chapter 6 in "PHP and MySQL Web Development" Course Topics Relational model SQL Database design Normalization PHP MySQL Database administration

More information

CSE 154 LECTURE 8: FORMS

CSE 154 LECTURE 8: FORMS CSE 154 LECTURE 8: FORMS Web data most interesting web pages revolve around data examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes can take many formats: text, HTML, XML, multimedia many

More information

Outline of Lecture 5. Course Content. Objectives of Lecture 6 CGI and HTML Forms

Outline of Lecture 5. Course Content. Objectives of Lecture 6 CGI and HTML Forms Web-Based Information Systems Fall 2004 CMPUT 410: CGI and HTML Forms Dr. Osmar R. Zaïane University of Alberta Outline of Lecture 5 Introduction Poor Man s Animation Animation with Java Animation with

More information

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018

Lecture 6: More Arrays & HTML Forms. CS 383 Web Development II Monday, February 12, 2018 Lecture 6: More Arrays & HTML Forms CS 383 Web Development II Monday, February 12, 2018 Lambdas You may have encountered a lambda (sometimes called anonymous functions) in other programming languages The

More information

Creating HTML files using Notepad

Creating HTML files using Notepad Reference Materials 3.1 Creating HTML files using Notepad Inside notepad, select the file menu, and then Save As. This will allow you to set the file name, as well as the type of file. Next, select the

More information

JavaScript CSCI 201 Principles of Software Development

JavaScript CSCI 201 Principles of Software Development JavaScript CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline JavaScript Program USC CSCI 201L JavaScript JavaScript is a front-end interpreted language that

More information

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab. Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 5049 Advanced Internet Technology Lab Lab # 1 Eng. Haneen El-masry February, 2015 Objective To be familiar with

More information

This is CS50. Harvard College Fall Quiz 1 Answer Key

This is CS50. Harvard College Fall Quiz 1 Answer Key Quiz 1 Answer Key Answers other than the below may be possible. Know Your Meme. 0. True or False. 1. T 2. F 3. F 4. F 5. T Attack. 6. By never making assumptions as to the length of users input and always

More information

CS Homework 6. Deadline. Purpose. How to submit. Important notes. Problem 1. Spring CS Homework 6 p. 1

CS Homework 6. Deadline. Purpose. How to submit. Important notes. Problem 1. Spring CS Homework 6 p. 1 Spring 2018 - CS 328 - Homework 6 p. 1 Deadline Due by 11:59 pm on Sunday, March 11, 2018. Purpose CS 328 - Homework 6 To encourage you to look over the course PHP style standards, and to give you more

More information

HTML Form. Kanida Sinmai

HTML Form. Kanida Sinmai HTML Form Kanida Sinmai ksinmai@tsu.ac.th http://mis.csit.sci.tsu.ac.th/kanida HTML Form HTML forms are used to collect user input. The element defines an HTML form: . form elements. Form

More information

PHP with MySQL: What you need to know Chapter 3. This section is on using PHP script tags appropriately in your PHP program.

PHP with MySQL: What you need to know Chapter 3. This section is on using PHP script tags appropriately in your PHP program. Chapter 3 PHP Basics 3.1 Using PHP Script Tags This section is on using PHP script tags appropriately in your PHP program. The beginning PHP tag () and the code in between those

More information

NETB 329 Lecture 13 Python CGI Programming

NETB 329 Lecture 13 Python CGI Programming NETB 329 Lecture 13 Python CGI Programming 1 of 83 What is CGI? The Common Gateway Interface, or CGI, is a set of standards that define how information is exchanged between the web server and a custom

More information

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data CS 418/518 Web Programming Spring 2014 HTML Tables and Forms Dr. Michele Weigle http://www.cs.odu.edu/~mweigle/cs418-s14/ Outline! Assigned Reading! Chapter 4 "Using Tables to Display Data"! Chapter 5

More information

Programming in C++ PART 2

Programming in C++ PART 2 Lecture 07-2 Programming in C++ PART 2 By Assistant Professor Dr. Ali Kattan 1 The while Loop and do..while loop In the previous lecture we studied the for Loop in C++. In this lecture we will cover iteration

More information

Writing Perl Programs using Control Structures Worked Examples

Writing Perl Programs using Control Structures Worked Examples Writing Perl Programs using Control Structures Worked Examples Louise Dennis October 27, 2004 These notes describe my attempts to do some Perl programming exercises using control structures and HTML Forms.

More information

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson reserved. 0-13-185603-0 HTML HELLO WORLD! Document

More information

<form>. input elements. </form>

<form>. input elements. </form> CS 183 4/8/2010 A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, text area fields, drop-down menus, radio buttons,

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 Web Database Programming Using PHP Techniques for programming dynamic features

More information

COSC344 Database Theory and Applications PHP & SQL. Lecture 14

COSC344 Database Theory and Applications PHP & SQL. Lecture 14 COSC344 Database Theory and Applications Lecture 14: PHP & SQL COSC344 Lecture 14 1 Last Lecture Java & SQL Overview This Lecture PHP & SQL Revision of the first half of the lectures Source: Lecture notes,

More information

Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event

Web Forms. Survey or poll Contact us Sign up for an  newsletter Register for an event Web Forms Survey or poll Contact us Sign up for an email newsletter Register for an event Web Forms All our web pages thus far have had a one-way flow of information, from us to our web visitors. Now we'll

More information

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed:

PHP Reference. To access MySQL manually, run the following command on the machine, called Sources, where MySQL and PhP have been installed: PHP Reference 1 Preface This tutorial is designed to teach you all the PHP commands and constructs you need to complete your PHP project assignment. It is assumed that you have never programmed in PHP

More information

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley PHP and MySQL for Dynamic Web Sites Intro Ed Crowley Class Preparation If you haven t already, download the sample scripts from: http://www.larryullman.com/books/phpand-mysql-for-dynamic-web-sitesvisual-quickpro-guide-4thedition/#downloads

More information

Advanced HTML Scripting WebGUI Users Conference

Advanced HTML Scripting WebGUI Users Conference Advanced HTML Scripting 2004 WebGUI Users Conference XHTML where did that x come from? XHTML =? Extensible Hypertext Markup Language Combination of HTML and XML More strict than HTML Things to Remember

More information

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun. Web Programming Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun. 1 World-Wide Wide Web (Tim Berners-Lee & Cailliau 92)

More information

PHP by Pearson Education, Inc. All Rights Reserved.

PHP by Pearson Education, Inc. All Rights Reserved. PHP 1992-2012 by Pearson Education, Inc. All Client-side Languages User-agent (web browser) requests a web page JavaScript is executed on PC http request Can affect the Browser and the page itself http

More information

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2

Chapter 11 Outline. A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming. Slide 11-2 Chapter 11 Outline A Simple PHP Example Overview of Basic Features of PHP Overview of PHP Database Programming Slide 11-2 1 Web Database Programming Using PHP Techniques for programming dynamic features

More information

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL Real 1 Options We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional

More information

cwhois Manual Copyright Vibralogix. All rights reserved.

cwhois Manual Copyright Vibralogix. All rights reserved. cwhoistm V2.12 cwhois Manual Copyright 2003-2015 Vibralogix. All rights reserved. This document is provided by Vibralogix for informational purposes only to licensed users of the cwhois product and is

More information

Lecture 7 PHP Basics. Web Engineering CC 552

Lecture 7 PHP Basics. Web Engineering CC 552 Lecture 7 PHP Basics Web Engineering CC 552 Overview n Overview of PHP n Syntactic Characteristics n Primitives n Output n Control statements n Arrays n Functions n WampServer Origins and uses of PHP n

More information

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus Lecture #23: SQLite

CSCI-UA: Database Design & Web Implementation. Professor Evan Sandhaus  Lecture #23: SQLite CSCI-UA:0060-02 Database Design & Web Implementation Professor Evan Sandhaus sandhaus@cs.nyu.edu evan@nytimes.com Lecture #23: SQLite Database Design and Web Implementation Administrivia! Homework HW 8

More information

Web technologies. Web. basic components. embellishments in browser. DOM (document object model)

Web technologies. Web. basic components. embellishments in browser. DOM (document object model) Web technologies DOM (document object model) what's on the page and how it can be manipulated forms / CGI (common gateway interface) extract info from a form, create a page, send it back server side code

More information

CGI Programming. What is "CGI"?

CGI Programming. What is CGI? CGI Programming What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)

More information

PHP. Interactive Web Systems

PHP. Interactive Web Systems PHP Interactive Web Systems PHP PHP is an open-source server side scripting language. PHP stands for PHP: Hypertext Preprocessor One of the most popular server side languages Second most popular on GitHub

More information

Web Engineering (Lecture 08) WAMP

Web Engineering (Lecture 08) WAMP Web Engineering (Lecture 08) WAMP By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester WAMP WAMP is all-in-one Apache/MySQL/PHP package WAMP stands for: i) Windows ii) iii) iv) Apache MySql PHP

More information

Basic PHP Lecture 17

Basic PHP Lecture 17 Basic PHP Lecture 17 Robb T. Koether Hampden-Sydney College Fri, Feb 24, 2012 Robb T. Koether (Hampden-Sydney College) Basic PHPLecture 17 Fri, Feb 24, 2012 1 / 30 1 PHP 2 Basic PHP 3 The Extended echo

More information

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6 CS 350 COMPUTER/HUMAN INTERACTION Lecture 6 Setting up PPP webpage Log into lab Linux client or into csserver directly Webspace (www_home) should be set up Change directory for CS 350 assignments cp r

More information

Spring 2014 Interim. HTML forms

Spring 2014 Interim. HTML forms HTML forms Forms are used very often when the user needs to provide information to the web server: Entering keywords in a search box Placing an order Subscribing to a mailing list Posting a comment Filling

More information

COM1004 Web and Internet Technology

COM1004 Web and Internet Technology COM1004 Web and Internet Technology When a user submits a web form, how do we save the information to a database? How do we retrieve that data later? ID NAME EMAIL MESSAGE TIMESTAMP 1 Mike mike@dcs Hi

More information

Introduction of PHP Created By: Umar Farooque Khan

Introduction of PHP Created By: Umar Farooque Khan 1 Introduction of PHP Created By: Umar Farooque Khan 2 What is PHP? PHP stand for hypertext pre-processor. PHP is a general purpose server side scripting language that is basically used for web development.

More information

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 FORMS SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: How to use forms and the related form types. Controls for interacting with forms. Menus and presenting users with

More information

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI INDEX No. Title Pag e No. 1 Implements Basic HTML Tags 3 2 Implementation Of Table Tag 4 3 Implementation Of FRAMES 5 4 Design A FORM

More information

PHP Introduction. Some info on MySQL which we will cover in the next workshop...

PHP Introduction. Some info on MySQL which we will cover in the next workshop... PHP and MYSQL PHP Introduction PHP is a recursive acronym for PHP: Hypertext Preprocessor -- It is a widely-used open source general-purpose serverside scripting language that is especially suited for

More information

MATLAB - Lecture # 4

MATLAB - Lecture # 4 MATLAB - Lecture # 4 Script Files / Chapter 4 Topics Covered: 1. Script files. SCRIPT FILE 77-78! A script file is a sequence of MATLAB commands, called a program.! When a file runs, MATLAB executes the

More information

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013 The Hypertext Markup Language (HTML) Part II Hamid Zarrabi-Zadeh Web Programming Fall 2013 2 Outline HTML Structures Tables Forms New HTML5 Elements Summary HTML Tables 4 Tables Tables are created with

More information

PIC 40A. Review for the Final. Copyright 2011 Jukka Virtanen UCLA 1 06/05/15

PIC 40A. Review for the Final. Copyright 2011 Jukka Virtanen UCLA 1 06/05/15 PIC 40A Review for the Final 06/05/15 Copyright 2011 Jukka Virtanen UCLA 1 Overview Final is on: Monday, June 08, 2015 11:30 AM - 2:30 PM Geology 4645 Double check on myucla.edu. 06/05/15 Copyright Jukka

More information

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics Form Overview CMPT 165: Form Basics Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University October 26, 2011 A form is an HTML element that contains and organizes objects called

More information

Week 13 Thursday (with Page 5 corrections)

Week 13 Thursday (with Page 5 corrections) Week 13 Thursday (with Page 5 corrections) Quizzes: HTML/CSS and JS available and due before 10 pm next Tuesday, May 1 st. You may do your own web research to answer, but do not ask classmates, friends,

More information

HTML: Fragments, Frames, and Forms. Overview

HTML: Fragments, Frames, and Forms. Overview HTML: Fragments, Frames, and Forms Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@ imap.pitt.edu http://www.sis. pitt.edu/~spring Overview Fragment

More information

JavaScript Functions, Objects and Array

JavaScript Functions, Objects and Array JavaScript Functions, Objects and Array Defining a Function A definition starts with the word function. A name follows that must start with a letter or underscore, followed by any number of letters, digits,

More information

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser. Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible

More information

COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts

COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts COMP284 Scripting Languages Lecture 10: PHP (Part 2) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

.. Documentation. Release 0.4 beta. Author

.. Documentation. Release 0.4 beta. Author .. Documentation Release 0.4 beta Author May 06, 2015 Contents 1 Browser 3 1.1 Basic usages............................................... 3 1.2 Form manipulation............................................

More information

cis20.2-spring2010-sklar-lecii.4 1

cis20.2-spring2010-sklar-lecii.4 1 cis20.2 design and implementation of software applications 2 spring 2010 lecture # II.4 today s topics: introduction to php on-line documentation http://www.php.net (php home page) http://www.php.net/manual/en/

More information

Simple variables and operators

Simple variables and operators Simple variables and operators Types of Data Once you are up and running with your own PHP programming, you'll find that the majority of your scripts are variables, operators, and under ten functions that

More information

CICS 515 b Internet Programming Week 2. Mike Feeley

CICS 515 b Internet Programming Week 2. Mike Feeley CICS 515 b Internet Programming Week 2 Mike Feeley 1 Software infrastructure stuff MySQL and PHP store files in public_html run on remote.mss.icics.ubc.ca access as http://ws.mss.icics.ubc.ca/~username/...

More information

D B M G. Introduction to databases. Web programming: the HTML language. Web programming. The HTML Politecnico di Torino 1

D B M G. Introduction to databases. Web programming: the HTML language. Web programming. The HTML Politecnico di Torino 1 Web programming The HTML language The HTML language Basic concepts User interfaces in HTML Forms Tables Passing parameters stored in forms @2017 Politecnico di Torino 1 Basic concepts HTML: HyperText Markup

More information

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL.

Hello everyone! Page 1. Your folder should look like this. To start with Run your XAMPP app and start your Apache and MySQL. Hello everyone! Welcome to our PHP + MySQL (Easy to learn) E.T.L. free online course Hope you have installed your XAMPP? And you have created your forms inside the studio file in the htdocs folder using

More information

BIS1523 Homework Assignments 2.1

BIS1523 Homework Assignments 2.1 Homework Assignments 2.1 Folder: hw01 Assignment #1, Bio Overview: Create a web page with some information (real or made up) about yourself. Your web page should include the following: A header, with your

More information

Final Exam. IT 3203 Introduction to Web Development. Rescheduling Final Exams. PHP Arrays. Arrays as Hashes. Looping over Arrays

Final Exam. IT 3203 Introduction to Web Development. Rescheduling Final Exams. PHP Arrays. Arrays as Hashes. Looping over Arrays IT 3203 Introduction to Web Development Introduction to PHP II April 5 Notice: This session is being recorded. Copyright 2007 by Bob Brown Final Exam The Registrar has released the final exam schedule.

More information

Fundamentals of Web Programming

Fundamentals of Web Programming Fundamentals of Web Programming Lecture 8: databases Devin Balkcom devin@cs.dartmouth.edu office: Sudikoff 206 http://www.cs.dartmouth.edu/~fwp http://localhost:8080/tuck-fwp/slides08/slides08db.html?m=all&s=0&f=0

More information

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP?

PHP 5 Introduction. What You Should Already Know. What is PHP? What is a PHP File? What Can PHP Do? Why PHP? PHP 5 Introduction What You Should Already Know you should have a basic understanding of the following: HTML CSS What is PHP? PHP is an acronym for "PHP: Hypertext Preprocessor" PHP is a widely-used, open

More information

CMPSCI 120 Fall 2017 Lab #4 Professor William T. Verts

CMPSCI 120 Fall 2017 Lab #4 Professor William T. Verts CMPSCI 120 Fall 2017 Lab #4 Professor William T. Verts Logging in and Renaming Files As you did in the previous assignments, log in to the UNIX server. Change into the public_html directory and create

More information

By the end of this section of the practical, the students should be able to:

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Learn about the Document Object Model and the Document Object Model hierarchy Create and use the properties, methods and event

More information

Databases HTML and PHP I. (GF Royle, N Spadaccini ) HTML/PHP I 1 / 28

Databases HTML and PHP I. (GF Royle, N Spadaccini ) HTML/PHP I 1 / 28 Databases HTML and PHP I (GF Royle, N Spadaccini 2006-2010) HTML/PHP I 1 / 28 This lecture The main purpose of this lecture is to cover HTML forms and how a PHP script can obtain values from the user.

More information

Web Scraping with Python

Web Scraping with Python Web Scraping with Python Carlos Hurtado Department of Economics University of Illinois at Urbana-Champaign hrtdmrt2@illinois.edu Dec 5th, 2017 C. Hurtado (UIUC - Economics) Numerical Methods On the Agenda

More information

Form Processing in PHP

Form Processing in PHP Form Processing in PHP Forms Forms are special components which allow your site visitors to supply various information on the HTML page. We have previously talked about creating HTML forms. Forms typically

More information

ITS331 IT Laboratory I: (Laboratory #11) Session Handling

ITS331 IT Laboratory I: (Laboratory #11) Session Handling School of Information and Computer Technology Sirindhorn International Institute of Technology Thammasat University ITS331 Information Technology Laboratory I Laboratory #11: Session Handling Creating

More information

1 Form Basics CSC309

1 Form Basics CSC309 1 Form Basics Web Data 2! Most interesting web pages revolve around data! examples: Google, IMDB, Digg, Facebook, YouTube! can take many formats: text, HTML, XML, multimedia! Many of them allow us to access

More information

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)

PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) PHP Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37) A Server-side Scripting Programming Language An Introduction What is PHP? PHP stands for PHP: Hypertext Preprocessor. It is a server-side

More information

CSCB20 Week 8. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017

CSCB20 Week 8. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017 CSCB20 Week 8 Introduction to Database and Web Application Programming Anna Bretscher* Winter 2017 *thanks to Alan Rosselet for providing the slides these are adapted from. Web Programming We have seen

More information

PHP with data handling

PHP with data handling 171 Lesson 18 PHP with data handling Aim Objectives : To provide an introduction data handling with PHP : To give an idea about, What type of data you need to handle? How PHP handle the form data? 18.1

More information

Web Security IV: Cross-Site Attacks

Web Security IV: Cross-Site Attacks 1 Web Security IV: Cross-Site Attacks Chengyu Song Slides modified from Dawn Song 2 Administrivia Lab3 New terminator: http://www.cs.ucr.edu/~csong/sec/17/l/new_terminator Bonus for solving the old one

More information

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29 HTML LBSC 690: Jordan Boyd-Graber October 1, 2012 LBSC 690: Jordan Boyd-Graber () HTML October 1, 2012 1 / 29 Goals Review Assignment 1 Assignment 2 and Midterm Hands on HTML LBSC 690: Jordan Boyd-Graber

More information

Secure Web-Based Systems Fall Test 1

Secure Web-Based Systems Fall Test 1 Secure Web-Based Systems Fall 2016 CS 4339 Professor L. Longpré Name: Directions: Test 1 This test is closed book and closed notes. However, you may consult the special cheat sheet provided to you with

More information

HTML and JavaScript: Forms and Validation

HTML and JavaScript: Forms and Validation HTML and JavaScript: Forms and Validation CISC 282 October 18, 2017 Forms Collection of specific elements know as controls Allow the user to enter information Submit the data to a web server Controls are

More information

Creating and Building Websites

Creating and Building Websites Creating and Building Websites Stanford University Continuing Studies CS 21 Mark Branom branom@alumni.stanford.edu Course Web Site: http://web.stanford.edu/group/csp/cs21 Week 7 Slide 1 of 25 Week 7 Unfinished

More information

Forms, CGI. HTML forms. Form example. Form example...

Forms, CGI. HTML forms. Form example. Form example... Objectives HTML forms The basics of HTML forms How form content is submitted GET, POST Elements that you can have in forms Responding to forms CGI the Common Gateway Interface Later: Servlets Generation

More information