=================== coffee-submit.php ==========================

Similar documents
CSE 190 M, Spring 2008, Final Exam ANSWER KEY

CSE 154: Web Programming Autumn 2018

Problem Description Earned Max 1 HTML / CSS Tracing 20 2 PHP 20 3 JS 20 4 JS / Ajax / JSON 20 5 SQL 20 X Extra Credit 1 TOTAL Total Points 100

G I F T U N I V E R S I T Y

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar

ITNP43: HTML Lecture 5

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

1.2 * allow custom user list to be passed in * publish changes to a channel

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

ToDoList. 1.2 * allow custom user list to be passed in * publish changes to a channel ***/

HTMLnotesS15.notebook. January 25, 2015

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Block & Inline Elements

CSE 154 Practice Exam from 16au

The Importance of the CSS Box Model

Five Advanced CSS Techniques Every Technical Author Should Know

Web Engineering CSS. By Assistant Prof Malik M Ali

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Psychology Experiments on the Web Using PHP and MySQL

Let's see a couple of examples

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

CSS: Layout, Floats, and More

FLOATING AND POSITIONING

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

Mobile Site Development

CSS for Page Layout Robert K. Moniot 1

COMS 359: Interactive Media

CSS Box Model. Cascading Style Sheets

APEX Developers - Do More With Less!!

Building Page Layouts

Signs of Spring App. Release Notes Version 1.0

Parashar Technologies HTML Lecture Notes-4

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

What do we mean by layouts?

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

HTML HTML5. DOM(Document Object Model) CSS CSS

CSS Cascading Style Sheets

IBM Bluemix Node-RED Watson Starter

CSS Selectors. element selectors. .class selectors. #id selectors

CE419 Web Programming. Session 3: HTML (contd.), CSS

Multimedia Systems and Technologies Lab class 6 HTML 5 + CSS 3

APEX Developers Do More With Less!! How do YOU manage your APEX CSS? Storage Options 1. Web server 2. APEX repository 3. In line 4.

Fetch terms and conditions apply. Fetch is only available for business banking purposes. The Kiwibank Fetch name, logos and related trademarks and

Introduction to Computer Science Web Development

Introduction to using HTML to design webpages

CSS: Lists, Tables and the Box Model

Assignments (4) Assessment as per Schedule (2)

CSS Module in 2 Parts

Adding CSS to your HTML

Pliki.tpl. boxes/languagelist/box.tpl. boxes/newsletter/box.tpl. scripts/basket/address.tpl

2005 WebGUI Users Conference

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

HTML & CSS. Rupayan Neogy

3. Each of these mark examples contains an error. a. <input name= country value= Your country here. /> b. <checkbox name= color value= teal />

CSS. Shan-Hung Wu CS, NTHU

Client-Side Web Technologies. CSS Part II

Exam 2 Reference Packet

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

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

Quick Start Guide. This guide will help you get started with Kentico CMS for ASP.NET. It answers these questions:

Lab 1: Introducing HTML5 and CSS3

/* ========================================================================== PROJECT STYLES

ITSE 1401 Web Design Tools Lab Project 4 (Expression Web 4 - Units M, N, O, P) Last revised: 1/9/14

Extra midterm question solutions 1. <div id="page"> <h1><img src="header.gif" alt="washington Beer - Home of the WASHINGTON BEER Commission" /></h1>

12/9/2012. CSS Layout

Create a cool image gallery using CSS visibility and positioning property

the missing manual0 O'REILLY Third Edition David Sawyer McFarland Beijing Cambridge The book that should have been in the box Farnham

AGENDA :: MULTIMEDIA TOOLS :: CLASS NOTES

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

Web Development. With PHP. Web Development With PHP

Web Design and Implementation

Zen Garden. CSS Zen Garden

CSS often uses hyphens in CSS property names but JavaScript uses camel case, e.g. color: blue; p { <!DOCTYPE html> <meta charset="utf-8" /> <head>

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

COMM 2555: Interactive Digital Communication / Spring 2018 Lab 9: Basic layout techniques with CSS

if(! list.contains(list.collect(params,'key'),'title')){ <div style="font-weight:bold;color:red;">"warning: A title field must be assigned.

Creating HTML files using Notepad

Getting your work online. behance.net cargo collective krop coroflot

CSS WHAT IS IT? HOW DOES IT WORK? (LOOK N GOOD)

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

Getting Started with CSS Sculptor 3

CSCU9B2: Web Tech Lecture 3

Creating and Building Websites

Pliki.tpl. scripts/search.tpl. Pliki.css. Pliki.less. Dokumentacja zmian plików graficznych: rwd shoper Wersja zmian:

Positioning in CSS: There are 5 different ways we can set our position:

Part 3: Images & form styling NOMZAMO S WEBSITE

Using CSS for page layout

Cascading Style Sheets CSCI 311

CSS.


Wireframe :: tistory wireframe tistory.

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Programmazione Web a.a. 2017/2018 HTML5

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Create a Web Page with Spry Navigation Bar. March 30, 2010

Transcription:

Solutions 1. CSS body { background-color: #DDD; #info img { float: right; height: 200px; margin: 10px; #info { padding-left: 2%; float: left; width:78%; #stats { width: 20%; float: left; background-color: #AAA; li { list-style: none; margin-bottom: 10px; margin-right: 5px; font-size: 10pt; ul { padding-left: 15px; h1, h3, #gallery { text-align: center; #gallery { clear: both; #gallery img { height: 130px; vertical-align: top; #main { border: 5px solid #AAA; overflow: hidden; width: 80%; margin-left: auto; margin-right: auto;

2. PHP =================== coffee.php ========================== $name = ""; $order = ""; $decaf = ""; if(isset($_cookie["name"])) { $name = $_COOKIE["name"]; if(isset($_cookie["order"])) { $order = $_COOKIE["order"]; if(isset($_cookie["decaf"])) { $decaf = $_COOKIE["decaf"]; <!DOCTYPE html> <html> <head> <title></title> </head> <body> <h1>coffee order form</h1> if(isset($_get["error"])) { <p>please fill out all required information</p> <form action="coffee-submit.php" method="post"> <div>name: <input type="text" name="name" value="<?=$name" /></div> <div>order: <input type="text" name="order" value="<?=$order" /></div> <div>decaf: <input type="checkbox" name="decaf" checked="<?=$decaf" /></div> <div><input type="submit" value="order it!" /></div> </form> </body> </html>

=================== coffee-submit.php ========================== if(!isset($_post["name"])!isset($_post["order"])) { header("location: raven.php?error=true"); die(); $name = $_POST["name"]; $order = $_POST["order"]; $decaf = $_POST["decaf"]; setcookie("name", $name); setcookie("order", $order); setcookie("decaf", $decaf); file_put_contents("orders.txt", "$name $order $decaf\n", FILE_APPEND); <!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>your coffee order of <?=$order will be delivered soon!</p> </body> </html>

3. PHP/JSON if(!isset($_get["type"])) { header("http/1.1 400 type not found"); die(); $type = $_GET["type"]; $array = array(); $array["type"] = $type; $pokemon = array(); $lines = file("$type.txt"); foreach ($lines as $line) { list($name $nickname $id $stage $weakness $description) = explode(" ", $line, 6); $poke = array(); $poke["name"] = $name; $poke["nickname"] = $nickname; $poke["pokedex_number"] = $id; $poke["stage"] = $stage; $poke["weakness"] = $weakness; $poke["description"] = $description; $pokemon[] = $poke; $array["pokemon"] = $pokemon; header("content-type: application/json"); print(json_encode($array));

4. AJAX/XML window.onload = function() { makerequest("begin"); ; function makerequest(nodeid) { var request = new XMLHttpRequest(); request.onload = processdata; request.open("get", "adventure.php?nodeid=" + nodeid, true); request.send(); function processdata() { if(this.status!= 200) { document.getelementbyid("answer").innerhtml = ""; document.getelementbyid("situationparagraph").innerhtml = "A " + this.status + " error has occurred"; else { var question = this.responsexml.queryselector("situation"); if(question) { document.getelementbyid("situationparagraph").innerhtml = question.textcontent; var answers = this.responsexml.queryselectorall("answer"); document.getelementbyid("answer").innerhtml = ""; for(var i = 0; i < answers.length; i++) { var button = document.createelement("button"); button.innerhtml = answers[i].textcontent; button.onclick = go; document.getelementbyid("answer").appendchild(button); else { document.getelementbyid("situationparagraph").innerhtml = this.responsexml.queryselector("end").getattribute("reason"); document.getelementbyid("answer").innerhtml = ""; function go() { makerequest(this.innerhtml);

5. Regex a) /^3[47][0-9]{13$/ b) /^[([0-9]+(, [0-9]+)*)?]$/ c) /^[0-9]+([+-*\%][0-9]+)+=[0-9]*$/ 6. SQL SELECT DISTINCT co.name FROM countries co JOIN languages l1 ON co.code = l1.country_code JOIN languages l2 ON co.code = l2.country_code JOIN cities ci1 ON co.code = ci1.country_code JOIN cities ci2 ON co.code = ci2.country_code WHERE l1.language = "english" AND (gnp - gnp_old) > 100 AND l1.language <> l2.language AND ci1.name <> ci2.name AND ci1.population > 1000000 AND ci2.population > 1000000 ORDER BY co.name