Assignments

Intro to Web Design Assignments


Advanced Webdesign Assignments

You First PHP Script

Create a PHP script using variables that stores and prints the following information (one variable per item):

A name:

e.g. Joe Smith

A zip code:

e.g. 77401

Any whole number:

e.g.# of children in the family in which you grew up = 133 (ok not really, but see what I mean)

A phrase in bold & italics (HTML):

e.g. The gecko ate my doughnut.

Any number with a decimal:

e.g. average airspeed of an unladed European swallow (in MPH) = 24.18

Create variables for each of these pieces of data and print the variables using PHP. Save the script as “variables.php” and put the file in your web directory (via FTP). If you don’t have an FTP account of yours isn’t working then email me and I’ll fix it.

To run your script you must enter the entire URL for “variables.php” into a web browser. For example: http://jn0074.picavulpes.net/variables.php

Embedded Widget Discussion

List at least one embedded technology (“widget” or “plugin”) used in web development. For example: a calendar add-on for a site, an RSS feed to add to a web page, a tool for embedding social networking into a site, etc. If possible, describe how such a technology might be used in a library/information science context.

more

Library Donation Exercise

Create a web form and a form-handling PHP script that accepts

donation information from a “Friend of the Library” to the mythical

SLIS Branch of the public library. more

Applying a Stylesheet

Apply the given style sheet to your existing web form for accepting

donations to the library. Also make sure to use this style sheet for the

resulting form handler page as well. Use the URL of the CSS instead of copying

the file to your own folder. Example

Using Loops and Arrays in PHP

Add a checkbox to the library donation form such that user can choose which days

are best to be contacted. Be sure to add square brackets to the name element in

the checkboxes so that you can process the variable as an array in your PHP script with

the “foreach” loop. more

Sending Mail with PHP

Collect all the donation form information together and have the script send you

the data in an email using the PHP mail command. The command for sending email in PHP

requires the following parameters: the recipient’s email, the subject, the message (as

one concatenated string), and optionally CC and Reply-To fields.

more

MySQL & PHP – Simple Blogging

Create scripts to make a database and table on the JayFox.net MySQL server,

add a blog entry to the database, view the blog, edit an entry, and delete and entry.

Feel free to use the example in-class scripts as a starting point.

Library Donation Assignment

Create a web form and a form handling PHP script that accepts

donation information from a “Friend of the Library” to the mythical

SLIS Branch of the public library.

    The HTML form should have the following fields:

  • first and last name as two text fields
  • address (including text boxes for street, city, state and zip use HTML to limit the zip field to 5 characters)
  • phone number as three separate text fields
  • library card number (use HTML to limit this to 11 digits)
  • a radio button set asking whether the donation should remain anonymous
  • a pull down menu with choices for type of donation: book, dvd, monetary
  • a text box for either the book or dvd name or the amount of money to donate
  • call the form page library_donation_form.html
  • have your form method be post and the action be handle_library_donation.php
  • don’t forget to include a submit button

    The script to handles the form should do the following:

  • print the first and last name in the format Firstname Lastname on one line
  • print the address and phone number in the format

    1001 Street Rd

    Cityville ST 12345

    713-295-2064

  • concatenate the phone number fields into one string
  • print the user’s library card number on a separate line
  • print “Donation anonymous:”
  • print the type of donation on a separate line
  • print either the book or dvd name or the amount of money for the donation

Apply the style sheet donation_style.css to your existing web form for accepting

donations to the library.

Also make sure to use this style sheet for the resulting form handler page as well.

There is an

example page

showing the effects of the style sheet. This design is based on

simplyfluid

from FreeCSSTemplates.org.

You can use the URL

http://www.jimmynewland.com/webdesign/donation_style.css

in your HTML code instead of copying the CSS to your own folder.

You can simply edit the existing page instead of creating a new page.

Add a checkbox to the library donation form such that user can choose which days

are best to be contacted. Be sure to add square brackets – [ ] – to the name element in

the checkboxes so that you can process the variable as an array in your PHP script.

Use the “foreach” loop to process the checkbox variable as an array. Use the

“add an event” (testsource)

from the text as a starting point.

Collect all the donation form information together and have the script send YOU

the data in an email message using the PHP mail command. The command for sending

email in PHP requires the following parameters: the recipient’s email, the subject,

the message (as one concatenated string), and optionally CC and Reply-To fields.

Example:

mail(email@someaddress.net, “Library Donation Form”, $message);

You can always use the in-class example for some guidance.