More examples will be added throughout the semester
W3C Validator - handles both HTML and CSS
W3C CSS-specific Validator
Basic HTML
- firstPage.html - very simple HTML
example
- bad.html - fails validation
- formatting.html -
simple formatting example including headings, line breaks, and
paragraphs
- links.html - examples
of including absolute and relative links
- lists.html - examples
of creating unordered, ordered, and definition lists
- images.html - examples
of including images on webpages
- table.html - tables with headings and blank cells
Image Map
Image maps weren't covered in class, but are discussed in Ch 2.20 in DWP.
CSS
Forms
- form.html - demonstrates the use/construction of forms
- echo.php (source) - PHP to echo back $_POST and $_GET parameters from a form
- validation.html - demonstrates the use of HTML validation for forms
Basic Authentication
- index.html - can only be viewed if you have the username and password (user1, abcd1234)
PHP
JavaScript
Examples in slides:
More examples:
- confirm.html - uses
confirm()
for form submission, if "ok" then submit, if "cancel" don't
- showdate1.html - print out the date using Date() and document.write (in body)
- showdate2.html - print out date with window.onload, getElementById(), and innerHTML (all in head)
- trickbutton.html - moves button on mouseover
- converter.html - converts from miles to km, using onclick and JS function
- badscript.html - version that doesn't work, use Web Console to debug
- consolelog.html - version that uses
console.log()
to write debug messages, view with Web Console
AJAX
jQuery
- clickToHide.html - hide all <p> elements on the page
- effects-ex.html - examples of jQuery effects: hide, show, slideDown, slideUp, fadeTo, fadeOut, fadeIn, animate
- methods-ex.html - examples of jQuery modifing HTML: html, append, prepend, after, before
- css-ex.html - examples of jQuery modifing CSS
- ajax-ex.html - examples of jQuery using AJAX, uses echo.php (source)
Some JavaScript/Ajax examples in jQuery:
Sessions
User Authentication
- index.php - demos register, login, secure resource, logout, and deregister
Using Databases
- pet.php (source) - demos creating, displaying, and adding elements to a pet database
- index.php - same as User Authentication example above, but using sqlite3 database