CSE 103 Day 20 Jo is out today; I’m Carl

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

HTML Basics and CSS style. Before we start Dreamweaver (DW) may take several minutes to start. Click on Start => Program Files => Development Apps =>
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Multiple Tiers in Action
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
U:/msu/course/cse/103 Day 25, Slide 1 Back-up PHP Files If you have not yet passed the 3.0 BT, make back-up copies of ALL.
INTRODUCTION TO DREAMWEAVER 8. What we already know…  Design basics  Contrast  Repetition  Alignment  Repetition  HTML.
U:/msu/course/cse/103 Day 10, Slide 1 CSE 103 Students: Your BTs have been graded. See Erica or Jo with questions or stay.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
PHP meets MySQL.
Getting Started with HTML Please use speaker notes for additional information!
HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup.
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
U:/msu/course/cse/103 Day 06, Slide 1 CSE students: Do not log in yet. Review Day 6 in your textbook. Think about.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
U:/msu/course/cse/103 Day 21, Slide 1 CSE 103 Makeups –If you didn’t take one over the weekend, take one TUESDAY or WEDNESDAY!
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
Chap 2 – Getting Started COMP YL Professor Mattos.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
PHP Syntax You cannot view the PHP source code by selecting "View source" in the browser - you will only see the output from the PHP file, which is plain.
PHP Form Processing * referenced from
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
Day 22, Slide 1 CSE 103 Day 22 Non-students: Please logout by 10:12. Students:
© Ms. Masihi.  A Web page contains text and images that convey specific information to viewers.  To create a new web page, open Dreamweaver and select.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Intro to HTML CS 1150 Spring 2017.
Module 1 Introduction to JavaScript
Retrieving Data Using the SQL SELECT Statement
Intro to HTML CS 1150 Fall 2016.
Dreamweaver MX Lesson 14: Using Find and Replace.
Creating Databases Local storage. join & split
Topic Pre-processor cout To output a message.
CHAPTER 5 SERVER SIDE SCRIPTING
European Computer Driving Licence
Learning the Basics – Lesson 1
This shows the user interface and the SQL Select for a situation with two criteria in an AND relationship.
Database application MySQL Database and PhpMyAdmin
Questions In the PHP script mysqltest.php :
mysql and mysql workbench
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Dreamweaver – Project #1
HTML Basics and CSS style
PHP / MySQL Introduction
BASIC PHP and MYSQL Edward S. Flores.
PHP Introduction.
Intro to PHP & Variables
Introduction to JavaScript
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Number and String Operations
WEB PROGRAMMING JavaScript.
Introduction to JavaScript
Integrating JavaScript and HTML
Using Cascading Style Sheets (CSS)
Intro to PHP.
Document Structure & HTML
Project 4 Creating an Image Map.
Creating your first website
European Computer Driving Licence
An Introduction to JavaScript
Grauer and Barber Series Microsoft Access Chapter One
EBSCOhost Advanced Search Guided Style
HTML Forms What are clients? What are servers?
Presentation transcript:

CSE 103 Day 20 Jo is out today; I’m Carl Sign up for a makeup if you haven’t taken one since the last in-class BT Must take one by Wednesday to get all your attempts in! More makeups coming later this week If you are not in the class, please save and log out. http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Clients, Servers and PHP What are servers? What are clients? What is PHP? How is PHP like HTML? How do you distinguish PHP code from HTML tags? Which computer executes the PHP code, the client or the server? What can you do using PHP that you can't do using HTML? http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Serving HTML files requests http://www.msu.edu/user/sparty/day06.html Server Client receives contents of U://msu/user/s/p/sparty/web/day06.html http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Serving PHP files requests http://cse103.egr.msu.edu/user/sparty/day20.php Client Server processes contents of U://msu/user/ s/p/sparty/web/ day20.php and returns results of processing receives result of PHP processing from server http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Dreamweaver MX Start Dreamweaver by going to: Start => Program Files => Development Apps => Web => Dreamweaver MX => Dreamweaver MX Seven parts of Dreamweaver window: Menu Bar Insert Panel Document Toolbar Document Window Properties Panel Files Panel Answers Panel http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Creating a Web page Use Dreamweaver Create an HTML file with the following paragraph: Welcome to my day 20 page for CSE 103. This page was created at 10:43AM on Thursday, March 24, 2005. If you look at the source, you will see that Dreamweaver has included the <html> <head> and <body> tags for you. Save the file in your web folder as day20.html http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Testing your page Browse to your page using www.msu.edu http://www.msu.edu/~MSUNETID/day20.html Does it look the way it should? Browse to your page using http://cse103.egr.msu.edu/user/msuNetid/day20.html Does the page look the same? http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Web Page Development Cycle EDIT and SAVE the file in your AFS space p:\web\day20.html TEST by BROWSING to the page http://cse103.egr.msu.edu/user/msuNetid/day20.html http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Moving from HTML to PHP Now save the file as day20.php. Again browse to this file. Any differences? In Dreamweaver, after the introductory paragraph, add a sentence that says: This page created with PHP version: All PHP code must be enclosed between <?php and ?>. Enter these tags. Note that you must use Code View! Everything between these two tags is treated as PHP Between these tags, include the command: print phpversion();  http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

PHP Before and After Save again and browse to this page View the source code for this page in the browser Compare that code to the day20.php script as viewed in Dreamweaver What is the same between these two views? What is different between them? http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Essence of PHP Start a "PHP block" with <?php Coming soon from CK Start a "PHP block" with <?php Place one or more PHP commands next: Each command must end with a semicolon All HTML outside PHP blocks is ignored by PHP All PHP is run first, before the page loads No PHP is sent to browser Can output text inside PHP with print (or echo) Can use HTML tags with print to format, or put an open HTML tag before a PHP block and a close HTML tag after the block (examples next slide) Close PHP block with ?> You may have many PHP blocks on one page http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

PHP and HTML formatting HTML formatting inside PHP blocks: <p>This page created with PHP <?php print "<i>"; print phpversion(); print "</i>"; ?></p> Displays as This page created with PHP 4.3.3 Notice use of multiple prints, semicolon after each one When printing literal strings (like the <i> tags), put them in quotes, just like in SQL We can open <?php … ?> blocks inside other HTML tags with no problem (this example is inside <p>…</p>) No extra space before/after <?php ?> helps keep the formatting right http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Including Pages © 2005 by <your name here> Create a file with an HTML fragment to contain your copyright notice: © 2005 by <your name here> Copyright symbol from Insert/Special Characters Do not include the standard tags (HTML, HEAD, BODY); only tags and text that go in the body of the page such as <p> or <b>. Save as copyright.php (in web folder). Now use the include() function to add this copyright notice into your day20.php file. For help, read the PHP Manual page on include() linked from today’s classwork page Look at examples, find one that's like what you want http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Reading the Documentation 101 Use the link on the today’s Classwork page to see documentation for PHP function date() Look at the description line: string date ( string format [, int timestamp]) string date(…): string is the type returned (output) by the function. All functions need () string format: a required parameter. It has to be of string type [, int timestamp]: an optional parameter (indicated by []). If we include this, we must put a comma after the format. It must of type int (integer) Keep reading to find notes and examples of each parameter http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Time Stamping a Page Use a PHP function to put a time stamp on your page date() writes date/time in a human-readable format See the Manual page linked to today’s class page Change the page so that it always displays the current time and date, i.e., replace: 10:43AM – Instead, show the time when the page is being viewed. Thursday, March 25, 2004 – Instead, show the date on which the page is being viewed. http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

Ultimate Bridge Task Work alone or in pairs (IF approved) Create database in Access; we convert to MySQL Create website using PHP to interface with db Include pages to add/edit data; use those to get data into db (we don't import data from Access) If you have a large set of pre-existing data, send an e-mail and we'll work something out. Demonstrate mastery of topics taught in class and ability to extend knowledge beyond that (new functions, new types of queries, etc.) http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

More UBT information General abstract available on classwork page Grading: 34% queries 22% design 24% PHP 12% General 8% HTML Work in pairs (if approved) but you lose 25% off the top and must do extra work to make up for that. Final grade: < 50%: 3.0; 50-74%: 3.5; 75%+ : 4.0 http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

A good UBT should: Demonstrate good database design Appropriate tables, fields, datatypes, keys, and relationships, as well as integrity and minimal redundancy (everything related to the 2.5 BT) Demonstrate mastery of various queries Both Select and Action, use of functions, calculated fields, inner/outer joins, aggregate functions, etc. (everything related to the 2.0, plus Action queries from the 1.5) Demonstrate ability to learn new concepts Use new functions, query types, etc. that we didn’t cover in-class or on any BT Many points here; don't miss this or you won't get 4.0 http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php

UBT Topics and Homework There is a list of suggested topics on today’s classwork page E-mail cse103@cse.msu.edu with your first three choices ASAP (by this Friday, April 1 at latest) Homework: Read textbook and links from day 19 homework, if you haven't already Practice date formatting http://www.cse.msu.edu/~cse103 http://cse103.egr.msu.edu/user/SPARTY/page.php