Web Development (ICA50601)

Diploma in Website Development (SWAN TAFE) Blog

Hints / Tips: WADC1-01 & WADC2-01

August 1st, 2006 · No Comments
Assessments · Hints and Tips




One of the problems we have encountered with this assessment item is that you are unsure of what is required for output. The images below will assist you to solve the problems.

Form layout hints

To begin with for the hints and tips we will look at form layout. If you wish to have a form such as shown below (click to enlarge picture):

Sample form

then the required XHTML will be (click to enlarge picture):

Form Code

The CSS to generate this form is:

[code]

#frmDetails legend {
background: #99CC99;
border: 2px solid #99CC99;
padding: 0.1em;
font-size: 1.2em;
color: #FFFFFF;
}

#frmDetails label {
width: 15em;
border-bottom: 1px solid #CCCCCC;
float: left;
}

#frmDetails fieldset {
background: #fff;
margin: 0em;
padding: 0.5em;
border: 2px solid #99CC99;
}

[/code]

Form submission hints

Note the address line contains NO arguments after the wk01-03.php file name.

When the form is submitted correctly then the results should look similar to those shown in the image below (click to enlarge):

Desired output from wk01-03.php

Also there will be an error message displayed when the form uses the wrong type of action – the desired action is a POST not a GET (click to enlarge picture):

Error message that should be displayed if a GET is used in the form

Date display hints

Also, if you want to display the current month then you can use something like:

[code]
echo date('M',mktime(0,0,0,$month));
[/code]

This displays the date which we have constructed to be 00:00:01 on the 1st day of $month in the current year. The mktime function converts a time given in the form hours, minutes, seconds, month, day and year into the number of seconds since the start of “computer time”.

You may miss any parameters out, but if you miss the minutes out then all the subsequent parameters must be missing. A missing parameter will be replaced with equivalent part of the current date/time value, eg: if it was currently 23 April 2005 at 11:20:56 then:

[code]
mktime(12,0,0,3)
[code]

would represent 12:00:00 on March 23, 2005.

Hope this helps.

Create a free edublog to get your own comment avatar (and more!)