Lecture 9. Forms & APIs 1 / 38

Size: px
Start display at page:

Download "Lecture 9. Forms & APIs 1 / 38"

Transcription

1 Lecture 9 Forms & APIs 1 / 38

2 Final Project Proposal Due November 12th 11:59PM Should include: A summary of your idea A diagram with the db tables you plan to use& the relationships between them You can make this by hand or withn an online tool: DbDesigner, QuickDBD Send via Piazza private post Complete rubric will be on the Syllabus by tomorrow. 2 / 38

3 Final Project Presentations You will demo your project to Sanjana & I during Reading Days Demos usually at Project Fair, not being held this year though 3 / 38

4 How was Homework 7? Vote at PollEv.com/cis / 38

5 Forms 5 / 38

6 HTML Forms Imagine a plain HTML form: <form action="/users" method="post"> <label for="name">name</label> <input type="text" name="name"> <label for=" "> </label> <input type="text" name=" "> <label for="password">password</label> <input type="password" name="password"> <input type="submit" value="create User"> </form> 6 / 38

7 What is an HTML form action? It's just like a controller action It specifies where the form data will be submitted to Vote at PollEv.com/cis / 38

8 What is an HTML form method? It specifies what kind of HTTP request the form should send It's just like a Ruby method Vote at PollEv.com/cis / 38

9 Forms with ERB In Rails, we don't have to write out our forms directly in HTML Rails gives us some form helpers that make our lives a little easier Types of form helpers available: form_with (Our focus) form_for (Pre-Rails 5.1) form_tag (Pre-Rails 5.1) 9 / 38

10 form_with Forms Most of the times we use forms in Rails involve creating/editing a specific instance form_with provides us an easy way to do this form_with also provides us with a simple way to make forms that are not associated with models In previous versions of Rails, we would have to use form_for to do the former and form_tag for the latter Although you can still use these, you should default to form_with in Rails 5.1 Take a look at the form_with documentation 10 / 38

11 form_with URL Example When our form is not associated with a model, we can use form_with and pass a url We use a block argument (generally called form) to build the form It is an instance of FormBuilder FormBuilder has instance methods that generate HTML form tags Like text fields, checkboxes, etc. 11 / 38

12 form_with Search Form Example <%= form_with(url: search_path, local: true) do form %> <div class="field"> <%= form.label :query %> <%= form.text_field :query %> </div> <div class="actions"> <%= form.submit 'Search' %> </div> <% end %> 12 / 38

13 Generates... <form action="/search" accept-charset="utf-8" method="post"> <input name="utf8" type="hidden" value=" "> <input type="hidden" name="authenticity_token" value="ivppd <div class="field"> <label for="query">query</label> <input type="text" name="query"> </div> <div class="actions"> <input type="submit" name="commit" value="search" data-di </div> </form> 13 / 38

14 form_with for Models form_with allows us to pass a model instance with the model parameter This will be used for forms that create/edit a model instance 14 / 38

15 form_with user Model Example <%= form_with(model: user, local: true) do form %> <div class="field"> <%= form.label :name %> <%= form.text_field :name, id: :user_name %> </div> <div class="field"> <%= form.label :password %> <%= form.password_field :password, id: :user_password %> </div> <div class="actions"> <%= form.submit %> </div> <% end %> 15 / 38

16 form_with user Model Example You would typically see the above form in _form.html.erb The same form is used for creating new instances as well as editing existing instances When creating a new instance, the fields will all be empty initially When editing an instance, the fields will be prepopulated with existing values What gets rendered depends on the instance that gets passed to the form 16 / 38

17 Generated form for new user <form action="/users" accept-charset="utf-8" method="post"> <input name="utf8" type="hidden" value=" "> <input type="hidden" name="authenticity_token" value="5dmx2 <div class="field"> <label for="user_name">name</label> <input id="user_name" type="text" name="user[name]"> </div> <div class="field"> <label for="user_password">password</label> <input id="user_password" type="password" name="user[pass </div> <div class="actions"> <input type="submit" name="commit" value="create User" da </div> </form> 17 / 38

18 Generated form for existing user <form action="/users/3" accept-charset="utf-8" method="post"> <input name="utf8" type="hidden" value=" "> <input type="hidden" name="_method" value="patch"> <input type="hidden" name="authenticity_token" value="ffvalfl <div class="field"> <label for="user_name">name</label> <input id="user_name" type="text" value="desmond" name="use </div> <div class="field"> <label for="user_password">password</label> <input id="user_password" type="password" name="user[passwo </div> <div class="actions"> <input type="submit" name="commit" value="update User" data </div> </form> 18 / 38

19 Hidden Form Fields Every form that we generate will have two hidden fields One will be named utf8 and the other authenticity_token The utf8 field will ensure that browsers submit the form in UTF-8 encoding mode The authenticity_token is used for security purposes 19 / 38

20 What is params? A hash that contains various information about the request A hash that just contains submitted form values Vote at PollEv.com/cis / 38

21 Nested Attributes You'll notice above that the names of the generated form_with model fields are of the form user[name], user[password] This will separate the data inside of params The attributes can be accessed via params through params[:user] { "user" => { "name" => "Jackie" } } 21 / 38

22 Deeper Nesting What we've seen so far has just been one level of nesting, we can nest further For example, assume we have books and pages tables When we create a new book, we want to create a couple of new pages with it We accomplish this with nested attributes 22 / 38

23 Four Steps to Nested Attributes (Not necessarily in this order) 1. Add the nested attributes to the form 2. Configure the book_params method in our controller to permit the new attributes 3. Configure the Book model to accept these parameters 4. Specify the max number of pages that we can create with a book inside of the controller's new action 23 / 38

24 Nested Attributes in _form.html.erb <%= form_with(model: book) do form %>... <%= form.fields_for :pages do page_form %> <div class="field"> <%= page_form.label :text %> <%= page_form.text_area :text %> </div> <div class="field"> <%= page_form.label :number %> <%= page_form.number_field :number %> </div> <% end %>... <% end %> 24 / 38

25 Generates... <form action="/books" accept-charset="utf-8" method="post">... <div class="field"> <label for="book_pages_attributes_0_page_text">text</label> <textarea name="book[pages_attribtues][0][text]"> </div> <div class="field"> <label for="book_pages_attributes_0_page_number">number</labe <input type="number" name="book[pages_attributes][0][number]" </div>... </form> 25 / 38

26 Mass Assignment Every time you scaffold, you get this model_name_params method We've kind of just glossed over it up to this point Mass assignment involves creating or updating an instance of a model with a hash For example: Book.new(params[:book]) The above pattern used to be the norm, until this happened in / 38

27 Strong Params Rails 4 introduced strong params to guard against the mass-assignment vulnerability Allows you to whitelist attributes that your server is allowed to accept This is generally a private method in your controller of the form model_name_params (e.g. book_params) Instead of Book.new(params[:book]), you use Book.new(book_params) 27 / 38

28 Strong Params Implementation This is usually a one-liner It first ensures that the key (:book in this case) is present within params It then specifies the attributes that you are allowed to pass along with the book Any params not permitted will be filtered out def book_params params.require(:book).permit(:title, :author_id, :publisher end 28 / 38

29 Strong Params & Nested Attributes Let's get back to our example of creating pages when we create a book If we want to create page(s) along with a book, we need to permit these attribtues with strong params def book_params params.require(:book).permit(:title, :author_id, :publisher pages_attributes: [:id, :text, :number]) end The id is necessary if we want to be able to edit pages through books later 29 / 38

30 Accept Nested Attributes in Model We need to specify that the Book model should accept_nested_attribtues_for pages This will allow books to edit and create pages that are associated with it Note that you could do the same inside of the Page class, but it doesn't make as much sense class Book < ApplicationRecord has_many :pages, inverse_of: :book, dependent: :destroy accepts_nested_attributes_for :pages, reject_if: :all_blank end 30 / 38

31 Nested Attributes in Controller Action Finally, we need to specify in the new action that the form should be able to create a certain number of pages with the book class BooksController < ApplicationController... def = Book.new 3.times } end... end 31 / 38

32 Using Forms with Nested Routes When you have a model nested under another, the nested model's form will require a tiny modification to work out of the box <%# By default, it'll come like this: %> <%= form_with(model: page, local: true) do form %> <%# You should change it to look like this: %> <%= form_with(model: [book, page], local: true) do form %> 32 / 38

33 Web APIs 33 / 38

34 Web APIs API stands for Application Programming Interface APIs provide endpoints for us to send HTTP requests to If we send a POST/PATCH request, we can create/update data on the API's server If we send a GET request, we can get back data from the API This data is often in the form of XML or JSON 34 / 38

35 Web API Example NASA has a web API that provides an Astronomy Picture of the Day We can send a GET request to: api_key=demo_key Visit this in your web browser to view the JSON that gets returned It might be a good idea to install a JSON formatter to work with this data 35 / 38

36 Authenticating with APIs Some APIs require is to authenticate with them before we can use APIs go about this in different ways, but often we'll have to: Create an account, Get an API key, And send this key with every request that we make The NASA API requires an API key It provides a default DEMO_KEY that we can make a limited number of requests with 36 / 38

37 Connecting to APIs in Ruby We can use Open URI to make requests to APIs in Ruby: require 'open-uri' open(' We can parse the JSON response into a usable Ruby hash: require 'open-uri' res = open(' json = JSON.parse(res.read) p json['date'] #=> " " 37 / 38

38 APIs in Homework 9 In homework 9, you will be connecting to the Spotify API We will use the RSpotify gem instead of directly making requires This is because Spotify requires us to authenticate and this is a little easier We will be able to play music from the Spotify API in this assignment! 38 / 38

Lecture 8. Validations & Sessions 1 / 41

Lecture 8. Validations & Sessions 1 / 41 Lecture 8 Validations & Sessions 1 / 41 Advanced Active Record 2 / 41 More Complex Queries Arel provides us with a number of methods to query our database tables So far, we've only used find which limits

More information

Lecture 4. Ruby on Rails 1 / 49

Lecture 4. Ruby on Rails 1 / 49 Lecture 4 Ruby on Rails 1 / 49 Client-Server Model 2 / 49 What is it? A client (e.g. web browser, phone, computer, etc.) sends a request to a server Request is an HTTP request Stands for HyperText Transfer

More information

Lecture 7. Action View, Bootstrap & Deploying 1 / 40

Lecture 7. Action View, Bootstrap & Deploying 1 / 40 Lecture 7 Action View, Bootstrap & Deploying 1 / 40 Homeworks 5 & 6 Homework 5 was graded Homework 6 was due last night Any questions? 2 / 40 How would you rate the di culty of Homework 6? Vote at http://pollev.com/cis196776

More information

Lecture 4. Ruby on Rails 1 / 52

Lecture 4. Ruby on Rails 1 / 52 Lecture 4 Ruby on Rails 1 / 52 Homeworks 2 & 3 Grades were released for homework 2 Homework 3 was due last night Everyone got a style freebie since my default setup ignores spec files and I didn't change

More information

Penetration Test Report

Penetration Test Report Penetration Test Report Feb 12, 2018 Ethnio, Inc. 6121 W SUNSET BLVD LOS angeles, CA 90028 Tel (888) 879-7439 ETHN.io Summary This document contains the most recent pen test results from our third party

More information

User Authentication and Session Control

User Authentication and Session Control User Authentication and Session Control CITS3403 Web & Internet Technologies Includes material from Agile Web Development with Rails, 3rd Ed, 2008 and 4 th Ed 2011, 2012 The Pragmatic Programmers. Slides

More information

Sign up. Chapter Signup form

Sign up. Chapter Signup form Chapter 8 Sign up Now that we have a working User model, it s time to add an ability few websites can live with out: letting users sign up for the site thus fulfilling the promise implicit in Section 53,

More information

CSC 405 Computer Security. Web Security

CSC 405 Computer Security. Web Security CSC 405 Computer Security Web Security Alexandros Kapravelos akaprav@ncsu.edu (Derived from slides by Giovanni Vigna and Adam Doupe) 1 The XMLHttpRequest Object Microsoft developers working on Outlook

More information

This allows us to use the cookbook code that was downloaded with InstantRails, instead of a new copy of that code. Why is this important?

This allows us to use the cookbook code that was downloaded with InstantRails, instead of a new copy of that code. Why is this important? The Cookbook Application, cont. To bring up the Cookbook application, create a new Ruby project (rightclick in Package Explorer view, then New Project. We name the project cookbook and then deselect the

More information

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security Lesson 3 Form By Raymond Tsang Certificate Programme in Cyber Security What is a form How to create a form Getting input from users Generate a result It s a section of a document containing normal content,

More information

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology Web Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie Sessions Web Development

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

Web Security: Vulnerabilities & Attacks

Web Security: Vulnerabilities & Attacks Computer Security Course. Web Security: Vulnerabilities & Attacks Type 2 Type 1 Type 0 Three Types of XSS Type 2: Persistent or Stored The attack vector is stored at the server Type 1: Reflected The attack

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

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

Developing Ajax Applications using EWD and Python. Tutorial: Part 2

Developing Ajax Applications using EWD and Python. Tutorial: Part 2 Developing Ajax Applications using EWD and Python Tutorial: Part 2 Chapter 1: A Logon Form Introduction This second part of our tutorial on developing Ajax applications using EWD and Python will carry

More information

CSE 154 LECTURE 19: FORMS AND UPLOADING FILES

CSE 154 LECTURE 19: FORMS AND UPLOADING FILES CSE 154 LECTURE 19: FORMS AND UPLOADING FILES Exercise: Baby name web service JSON Modify our babynames.php service to produce its output as JSON. For the data: Morgan m 375 410 392 478 579 507 636 499

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

Rails Routing Roundup

Rails Routing Roundup Rails Routing Roundup Rails Routing Roundup David A. Black Ruby Power and Light, LLC http://www.rubypal.com 1 Roadmap Basics of routing system Recognition Generation Defining routes (routing rules) in

More information

Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University Server-Side Web Programming: Python (Part 1) Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University 1 Objectives You will learn about Server-side web programming in Python Common Gateway Interface

More information

Composer Help. Web Request Common Block

Composer Help. Web Request Common Block Composer Help Web Request Common Block 7/4/2018 Web Request Common Block Contents 1 Web Request Common Block 1.1 Name Property 1.2 Block Notes Property 1.3 Exceptions Property 1.4 Request Method Property

More information

Ruby on Rails 3. Robert Crida Stuart Corbishley. Clue Technologies

Ruby on Rails 3. Robert Crida Stuart Corbishley. Clue Technologies Ruby on Rails 3 Robert Crida Stuart Corbishley Clue Technologies Topic Overview What is Rails New in Rails 3 New Project Generators MVC Active Record UJS RVM Bundler Migrations Factory Girl RSpec haml

More information

6.170 Tutorial 7 - Rails Security. Prerequisites. Goals of this tutorial. Resources

6.170 Tutorial 7 - Rails Security. Prerequisites. Goals of this tutorial. Resources 6.170 Tutorial 7 - Rails Security Introduction Sessions Session Hijacking Replay Attacks Session Fixation CSRF Hackers Love Mass Assignment Injection SQL Injection Cross Site Scripting (XSS) Logging Authorizing

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

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

Web Development and HTML. Shan-Hung Wu CS, NTHU

Web Development and HTML. Shan-Hung Wu CS, NTHU Web Development and HTML Shan-Hung Wu CS, NTHU Outline How does Internet Work? Web Development HTML Block vs. Inline elements Lists Links and Attributes Tables Forms 2 Outline How does Internet Work? Web

More information

At the Forge Prototype Reuven M. Lerner Abstract Prototype eases the burden of using JavaScript in Ajax. During the last few months, we have looked at ways to use JavaScript, a version of which is included

More information

Technical Guide Login Page Customization

Technical Guide Login Page Customization Released: 2017-11-15 Doc Rev No: R2 Copyright Notification Edgecore Networks Corporation Copyright 2019 Edgecore Networks Corporation. The information contained herein is subject to change without notice.

More information

CSCI-2320 Web Programming: Ruby on Rails

CSCI-2320 Web Programming: Ruby on Rails CSCI-2320 Web Programming: Ruby on Rails Mohammad T. Irfan Plan u Model-View-Controller (MVC) framework of web programming u Ruby on Rails 1 Ruby on Rails u Developed by David Hansson released 2004 u MVC

More information

At the Forge RJS Templates Reuven M. Lerner Abstract The power of Ajax to fetch and run JavaScript generated by your server-side language. The past few months, I've written a number of articles in this

More information

Rails: Views and Controllers

Rails: Views and Controllers Rails: Views and Controllers Computer Science and Engineering College of Engineering The Ohio State University Lecture 18 Recall: Rails Architecture Wiring Views and Controllers A controller is just an

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

Ajax Application Design

Ajax Application Design Ajax Application Design Reuven M. Lerner Abstract Asynchronous is the operative word with Ajax, and here's what it's all about. During the past few months, I've used this column to explore a number of

More information

GraphQL. Concepts & Challenges. - I m Robert Mosolgo - Work from home Ruby developer - From Charlottesville VA - For GitHub

GraphQL. Concepts & Challenges. - I m Robert Mosolgo - Work from home Ruby developer - From Charlottesville VA - For GitHub GraphQL Concepts & Challenges - I m Robert Mosolgo - Work from home Ruby developer - From Charlottesville VA - For GitHub Rails API WHY - You have your Rails app, why bother with an API? - You have clients.

More information

Problem: Write HTML would create web page depicted below. Your solution must include the following types of HTML elements (and no other

Problem: Write HTML would create web page depicted below. Your solution must include the following types of HTML elements (and no other Problem: Write HTML would create web page depicted below. Your solution must include the following types of HTML elements (and no other types):!doctype, a (with href attribute), body, h1, head, html, img

More information

Jquery Ajax Json Php Mysql Data Entry Example

Jquery Ajax Json Php Mysql Data Entry Example Jquery Ajax Json Php Mysql Data Entry Example Then add required assets in head which are jquery library, datatable js library and css By ajax api we can fetch json the data from employee-grid-data.php.

More information

Lecture 6. Active Record Associations 1 / 34

Lecture 6. Active Record Associations 1 / 34 Lecture 6 Active Record Associations 1 / 34 Midterm Course Evaluations https://goo.gl/forms/0ddvh2gqox60fwm13 2 / 34 Learn HTML You're going to be writing your own views in the next HW Make sure to familiarise

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

SMS GATEWAY API INTEGRATION GUIDE

SMS GATEWAY API INTEGRATION GUIDE SMS GATEWAY API INTEGRATION GUIDE For PHP Developers Are you a developer or bulk SMS reseller? You can interface your application, website or system with our 247 reliable messaging gateway by using our

More information

Forms, CGI. Cristian Bogdan 2D2052 / 2D1335 F5 1

Forms, CGI. Cristian Bogdan 2D2052 / 2D1335 F5 1 Forms, CGI Cristian Bogdan 2D2052 / 2D1335 F5 1 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

More information

Courslets, a golf improvement web service. Peter Battaglia

Courslets, a golf improvement web service. Peter Battaglia Courslets, a golf improvement web service Peter Battaglia Discussion Project Overview Design and Technologies Utilized Rails and REST URLs, URLs, URLs Rails and Web Services What s s exposed as a service?

More information

Rails: MVC in action

Rails: MVC in action Ruby on Rails Basic Facts 1. Rails is a web application framework built upon, and written in, the Ruby programming language. 2. Open source 3. Easy to learn; difficult to master. 4. Fun (and a time-saver)!

More information

Ruby on Rails Secure Coding Recommendations

Ruby on Rails Secure Coding Recommendations Introduction Altius IT s list of Ruby on Rails Secure Coding Recommendations is based upon security best practices. This list may not be complete and Altius IT recommends this list be augmented with additional

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University Computer Sciences Department 1 And use http://www.w3schools.com/ PHP Part 3 Objectives Creating a new MySQL Database using Create & Check connection with Database

More information

TM-800/1000 and TS-700/900 Administrator Manual

TM-800/1000 and TS-700/900 Administrator Manual TM-800/1000 and TS-700/900 Administrator Manual Version 4.0 The RHUB web conferencing and remote support appliance RHUB Communications, Inc. 4340 Stevens Creek Blvd. Suite 282 San Jose, CA 95129 support@rhubcom.com

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

Black Box DCX3000 / DCX1000 Using the API

Black Box DCX3000 / DCX1000 Using the API Black Box DCX3000 / DCX1000 Using the API updated 2/22/2017 This document will give you a brief overview of how to access the DCX3000 / DCX1000 API and how you can interact with it using an online tool.

More information

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points Files to submit: 1. HW7.py THIS IS AN INDIVIDUAL ASSIGNMENT! You should work individually on this assignment.

More information

Monetra. POST Protocol Specification

Monetra. POST Protocol Specification Monetra POST Protocol Specification Programmer's Addendum v1.0 Updated November 2012 Copyright Main Street Softworks, Inc. The information contained herein is provided As Is without warranty of any kind,

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

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity HTML Forms Overview of Forms Forms are used all over the Web to: Accept information Provide interactivity Types of forms: Search form, Order form, Newsletter sign-up form, Survey form, Add to Cart form,

More information

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies CNIT 129S: Securing Web Applications Ch 3: Web Application Technologies HTTP Hypertext Transfer Protocol (HTTP) Connectionless protocol Client sends an HTTP request to a Web server Gets an HTTP response

More information

Homework 5: Exam Review

Homework 5: Exam Review CIS 331 April 18, 2017 Introduction to Networks & Security Homework 5: Exam Review Homework 5: Exam Review This homework is due Wednesday, April 26 at 10 p.m.. You will have a budget of five late days

More information

Contents in Detail. Foreword by Xavier Noria

Contents in Detail. Foreword by Xavier Noria Contents in Detail Foreword by Xavier Noria Acknowledgments xv xvii Introduction xix Who This Book Is For................................................ xx Overview...xx Installation.... xxi Ruby, Rails,

More information

External HTTPS Trigger AXIS Camera Station 5.06 and above

External HTTPS Trigger AXIS Camera Station 5.06 and above HOW TO External HTTPS Trigger AXIS Camera Station 5.06 and above Created: October 17, 2016 Last updated: November 19, 2016 Rev: 1.2 1 Please note that AXIS does not take any responsibility for how this

More information

Postman Quick Reference Guide Documentation

Postman Quick Reference Guide Documentation Postman Quick Reference Guide Documentation Release Version 1.0.1 - March 2018 Valentin Despa Aug 22, 2018 Contents: 1 Cheatsheet 1 1.1 Postman Cheatsheet........................................... 1

More information

We have purposely designed the sendspace API to be easy to implement and as versatile as possible, regardless of platform and programming language.

We have purposely designed the sendspace API to be easy to implement and as versatile as possible, regardless of platform and programming language. Main Welcome to the home of our Application Programming Interface (API) 1.1, which allows you to embed sendspace services in your applications, programs, or scripts. We have purposely designed the sendspace

More information

Web basics: HTTP cookies

Web basics: HTTP cookies Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh November 20, 2017 1 / 32 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the

More information

Web basics: HTTP cookies

Web basics: HTTP cookies Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh February 11, 2016 1 / 27 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the

More information

CIS 3308 Logon Homework

CIS 3308 Logon Homework CIS 3308 Logon Homework Lab Overview In this lab, you shall enhance your web application so that it provides logon and logoff functionality and a profile page that is only available to logged-on users.

More information

CS Homework 4 p. 1. CS Homework 4

CS Homework 4 p. 1. CS Homework 4 CS 328 - Homework 4 p. 1 Deadline Due by 11:59 pm on Sunday, February 19, 2017 Purpose CS 328 - Homework 4 To practice some more with PL/SQL stored subroutines and "strict"-style HTML5 (now also including

More information

MVC :: Understanding Views, View Data, and HTML Helpers

MVC :: Understanding Views, View Data, and HTML Helpers MVC :: Understanding Views, View Data, and HTML Helpers The purpose of this tutorial is to provide you with a brief introduction to ASP.NET MVC views, view data, and HTML Helpers. By the end of this tutorial,

More information

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach Web basics: HTTP cookies Myrto Arapinis School of Informatics University of Edinburgh March 30, 2015 How is state managed in HTTP sessions HTTP is stateless: when a client sends a request, the server sends

More information

Lecture 5 Security and User Input. INLS 760 Web Databases Spring 2013 Rob Capra

Lecture 5 Security and User Input. INLS 760 Web Databases Spring 2013 Rob Capra Lecture 5 Security and User Input INLS 760 Web Databases Spring 2013 Rob Capra Security What data should be stored on a web server? HTTP logs? Users account information? Passwords? Possible harms Exposure

More information

CS193X: Web Programming Fundamentals

CS193X: Web Programming Fundamentals CS193X: Web Programming Fundamentals Spring 2017 Victoria Kirst (vrk@stanford.edu) Schedule Today: - Fetch - JSON - Fetch in an class - Querying REST APIs - Form submission - HW4 out! GitHub repo for today's

More information

Getting Data from the Web with R

Getting Data from the Web with R Getting Data from the Web with R Part 7: Getting Data via Web Forms Gaston Sanchez April-May 2014 Content licensed under CC BY-NC-SA 4.0 Readme License: Creative Commons Attribution-NonCommercial-ShareAlike

More information

CSE 154 LECTURE 9: SUBMITTING DATA (POST)

CSE 154 LECTURE 9: SUBMITTING DATA (POST) CSE 154 LECTURE 9: SUBMITTING DATA (POST) Drop-down list: , menus of choices that collapse and expand (inline) jerry george

More information

IBM Security Access Manager What s in the box : InfoMap Authentication Mechanism IBM SECURITY SUPPORT OPEN MIC. 13 Dec 2017

IBM Security Access Manager What s in the box : InfoMap Authentication Mechanism IBM SECURITY SUPPORT OPEN MIC. 13 Dec 2017 IBM Security Access Manager What s in the box : InfoMap Authentication Mechanism IBM SECURITY SUPPORT OPEN MIC 13 Dec 2017 IBM Security Learning Academy www.securitylearningacademy.com New content published

More information

The core of Tapestry's form support is the Form component. The Form component encloses (wraps around) all the other field components such

The core of Tapestry's form support is the Form component. The Form component encloses (wraps around) all the other field components such Forms and Validation Forms are the traditional way for most web applications to gather significant information from the user. Whether it's a search form, a login screen or a multi-page registration wizard,

More information

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar HTML Tables and Forms Chapter 5 2017 Pearson http://www.funwebdev.com - 2 nd Ed. HTML Tables A grid of cells A table in HTML is created using the element Tables can be used to display: Many types

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

TRANSFER MANAGER 2017

TRANSFER MANAGER 2017 TRANSFER MANAGER 2017 LAST UPDATED: JULY 2017 System enhancements are located in Resolved system issues are located in WHAT S IMPROVED? BEFORE YOU BEGIN WEB SERVICE The Transfer Manager 2017 Web Service

More information

Introducing ASP.NET Web Pages Updating Database Data

Introducing ASP.NET Web Pages Updating Database Data Introducing ASP.NET Web Pages Updating Database Data By Tom FitzMacken last updated May 28, 2015 This tutorial shows you how to update change an existing database entry when you use ASP.NET Web Pages Razor.

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

Kendo UI Builder by Progress : Using Kendo UI Designer

Kendo UI Builder by Progress : Using Kendo UI Designer Kendo UI Builder by Progress : Using Kendo UI Designer Notices 2016 Telerik AD. All rights reserved. November 2016 Last updated with new content: Version 1.1 3 Notices 4 Contents Table of Contents Chapter

More information

Dynamic Form Processing Tool Version 5.0 November 2014

Dynamic Form Processing Tool Version 5.0 November 2014 Dynamic Form Processing Tool Version 5.0 November 2014 Need more help, watch the video! Interlogic Graphics & Marketing (719) 884-1137 This tool allows an ICWS administrator to create forms that will be

More information

Apache Wicket. Java Web Application Framework

Apache Wicket. Java Web Application Framework Apache Wicket Java Web Application Framework St. Louis - Java User s Group Luther Baker September 2009 What is Wicket? Web Application Framework Component-based Framework Wicket 1.4 is Java 1.5+ compliant

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 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

HTML forms and the dynamic web

HTML forms and the dynamic web HTML forms and the dynamic web Antonio Lioy < lioy@polito.it > english version created by Marco D. Aime < m.aime@polito.it > Politecnico di Torino Dip. Automatica e Informatica timetable.html departure

More information

Oracle Eloqua HIPAA Advanced Data Security Add-on Cloud Service

Oracle Eloqua HIPAA Advanced Data Security Add-on Cloud Service http://docs.oracle.com Oracle Eloqua HIPAA Advanced Data Security Add-on Cloud Service Configuration Guide 2018 Oracle Corporation. All rights reserved 07-Jun-2018 Contents 1 HIPAA 3 1.0.1 What is HIPAA?

More information

Ruby%on%Rails% Ruby%on%Rails% %,% 1

Ruby%on%Rails% Ruby%on%Rails% %,% 1 Ruby%on%Rails% by#@tonytonyjan Ruby%on%Rails% %,% 1 / /tonytonyjan tonytonyjan.net Ruby-on-Rails- TJDict-Chrome- Rails-Girls-Taipei-1~5- Ruby%on%Rails% %,% 2 Ruby&(Rails) C&(Qt) Java&(Swing) Network&Programming

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

Using OAuth 2.0 to Access ionbiz APIs

Using OAuth 2.0 to Access ionbiz APIs Using OAuth 2.0 to Access ionbiz APIs ionbiz APIs use the OAuth 2.0 protocol for authentication and authorization. ionbiz supports common OAuth 2.0 scenarios such as those for web server, installed, and

More information

The system has several front-end content discovery options. Here are examples of their interfaces (see more on our site at

The system has several front-end content discovery options. Here are examples of their interfaces (see more on our site at November, 2014 1 TrenDemon is a content marketing platform which helps boost conversions from your existing traffic and content using personalized recommendations and call to actions. The system has several

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

DocuSign PowerForms User Guide

DocuSign PowerForms User Guide Information Guide 1 DocuSign PowerForms User Guide 2 Copyright 2003-2015 DocuSign, Inc. All rights reserved. For information about DocuSign trademarks, copyrights and patents refer to the DocuSign Intellectual

More information

Table of Contents. Developer Manual...1

Table of Contents. Developer Manual...1 Table of Contents Developer Manual...1 API...2 API Overview...2 API Basics: URL, Methods, Return Formats, Authentication...3 API Errors...4 API Response Examples...6 Get Articles in a Category...6 Get

More information

CSS Review. Objec(ves. Iden(fy the Errors. Fixed CSS. CSS Organiza(on

CSS Review. Objec(ves. Iden(fy the Errors. Fixed CSS. CSS Organiza(on Objec(ves CSS Review Discuss: Ø How Google Search Works Ø What Images You Can Use HTML Forms CSS Review Why CSS? What is the syntax of a CSS rule? What is the order of applying rules in the cascade? How

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

UR what? ! URI: Uniform Resource Identifier. " Uniquely identifies a data entity " Obeys a specific syntax " schemename:specificstuff

UR what? ! URI: Uniform Resource Identifier.  Uniquely identifies a data entity  Obeys a specific syntax  schemename:specificstuff CS314-29 Web Protocols URI, URN, URL Internationalisation Role of HTML and XML HTTP and HTTPS interacting via the Web UR what? URI: Uniform Resource Identifier Uniquely identifies a data entity Obeys a

More information

Client Side JavaScript and AJAX

Client Side JavaScript and AJAX Client Side JavaScript and AJAX Client side javascript is JavaScript that runs in the browsers of people using your site. So far all the JavaScript code we've written runs on our node.js server. This is

More information

Faculty Web Page Management System. Help Getting Started

Faculty Web Page Management System. Help Getting Started Faculty Web Page Management System Help Getting Started 2 Table of Contents Faculty Web Page Management System...1 Help Getting Started...1 Table of Contents...2 Manage My Personal Information...3 Creating

More information

HTML5 a clear & present danger

HTML5 a clear & present danger HTML5 a clear & present danger Renaud Bidou CTO 1/29/2014 Deny All 2012 1 1/29/2014 Deny All 2013 1 Menu 1. HTML5 new capabilities 2. HTML5 tricks 3. Empowering common threats 4. Hackers dreams come true

More information

Javascript, Java, Flash, Silverlight, HTML5 (animation, audio/video, ) Ajax (asynchronous Javascript and XML)

Javascript, Java, Flash, Silverlight, HTML5 (animation, audio/video, ) Ajax (asynchronous Javascript and XML) Web technologies browser sends requests to server, displays results DOM (document object model): structure of page contents forms / CGI (common gateway interface) client side uses HTML/CSS, Javascript,

More information

Introduction to HTTP. Jonathan Sillito

Introduction to HTTP. Jonathan Sillito Introduction to HTTP Jonathan Sillito If you interested in working with a professor next Summer 2011 apply for an NSERC Undergraduate Student Award. Students must have a GPA of 3.0 or higher to be eligible.

More information

Mixed Signals Using Fusion s Signals API

Mixed Signals Using Fusion s Signals API Mixed Signals Using Fusion s Signals API One of my favorite features in Fusion is the Signals API a RESTful, flexible, easily implemented mechanism for capturing interesting user events, like (but not

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

REST in a Nutshell: A Mini Guide for Python Developers

REST in a Nutshell: A Mini Guide for Python Developers REST in a Nutshell: A Mini Guide for Python Developers REST is essentially a set of useful conventions for structuring a web API. By "web API", I mean an API that you interact with over HTTP - making requests

More information

Enterprise Knowledge Platform Adding the Login Form to Any Web Page

Enterprise Knowledge Platform Adding the Login Form to Any Web Page Enterprise Knowledge Platform Adding the Login Form to Any Web Page EKP Adding the Login Form to Any Web Page 21JAN03 2 Table of Contents 1. Introduction...4 Overview... 4 Requirements... 4 2. A Simple

More information