Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Complete PHP example - Registering for a get-together

DESCRIPTION OF THE APPLICATION

Scenario - we're holding a get-together of a number of friends. The friends are going to each bring along some food, and we want to co-ordinate this so that we don't end up with all desserts and no starters, nor do we want two people both to provide whole salmon!

This is a complete example of a PHP application, with cookies to allow users to return and be recognised without having to login again, but also allowing users to use their email address as a user name so that they can check back in from a different computer or if they're not keeping cookies.

The whole application is a single PHP file, which can generate two totally different HTML pages.

NEW USERS

New or unrecognised (i.e. no cookie) users are provided with a form into which they can enter their name, email address, and details such as whether they plan to come and what sort of dish they would like to bring - they're given a suggestion as to which course they should provide.

Once a new user has completed the form, he is presented with details of who's said they're coming (and who has said they won't be there) and all the various dishes that have been promised. The user also has his personal information echoed on the page - such as where he's coming from and who he's bringing.

A further link allows him to go back and edit his entries via the initial page, which is now pre-completed by the PHP script so that he doesn't have to enter data from scratch.

EXISTING USERS WHO ARE RECOGNISED

A returning visitor to the web site should be recognised by their cookie, and they'll be taken straight to the page detailing who's said they're coming, and they'll be reminded what dish they've promised to bring. This page will automatically be up to date, as it will be generated from the information held on file on the server as it's called up.

Just in case the user is recognised incorrectly (for example, if two people are sharing the same account and computer), a link is provided back to the "New User" pages ... "Follow this link if you are NOT John Smith" ....

The existing user can also jump back to the data entry page to make changes (confirm an attendance, change a dish to be provided, etc.).

EXISTING USERS WHO ARE NOT RECOGNISED

If a site visitor hasn't accepted our cookie, has logged in from a different computer of account, or has cleared down his cookie file, he won't be recognised automatically.

He'll be offered the "New User" login page, but all he has to do is to under his email address (the same one he registered with the site!) and he'll be taken straight in to his details.

Since this application will only be run for a few weeks and is intended as a simple tool, we haven't overburdened it with password protection, etc. Although passwords would provide better security, people really won't want to be bothered with them just to attend a get together!

NOTES ON CODE INTERNALS AND DETAILS

The complete PHP file is reproduced at the end of this module; by the time you come to follow this code, you should be well aware of most of the facilities of PHP so we'll just point you in the direction of some salient points in this example.

RECOGNISING WHICH PAGE IS TO BE OFFERED

In order to recognise which page is to be offered to the user, the PHP code checks whether cookies and/or certain fields are present in the incoming form. The very start of the script reads:

<?php
if ($new or ! $beenherebefore) {
        $needcookie = 1;
        $oldie = 1;
} else {
        if ($update) {
                $oldie = 2;
        } else {
                $oldie = 3;
        }
}

The variable $new is set from the incoming form data ... it's hard coded into an Anchor tag and allows someone to say "No - I'm not the person that you think I am" to the script. The variable $beenherebefore is set from a cookie.

Like the $new variable, the $update variable is set in an anchor tag and used to tell the script what the user wants do do - in this case to update the details that he/she entered on a previous occasion.

Once this initial work has been done, the $oldie variable has been set to:
 1 this is a new user - get their details
 2 this is a user who wants to update their details
 3 this is a known user looking for an update on who's
  coming and what they're bringing.
and this variable is then used through the rest of the script to select the program code to be run and the HTML code to be sent.

STORAGE OF DATA

Although this example uses a single file to contain both the PHP code and all the HTML, a separate set of files is used to store the data that users have entered onto the site. This really has to be the case, as the script is a non-changing file whereas the data will be changed. Programmers HAVE written self-modifying programs in the past (e.g. storing the data directly in the same file), but this is typically a dreadful idea.

How to store the data then? Options include:
 a plain text file
 a series of plain text files
 XML
 in a relational database such as MySQL

This is a small application, not a major system and we may not have SQL software available ... SQL would be "overkill" for our needs; I probably would have selected SQL if there was a further booking system involved, the need to email people as the date of the event got nearer, to check up on payments and invoices, etc. ...

XML would be similarly tempting for an expanded application, especially where the data had to be extracted in a wide variety of different formats.

A single plain text file, on the other hand, is just too basic. Each time a user enters of updates their data, the entire file would need to be read in, the information entered, and the file re-saved. A bit messy, and we could have a potential data locking / synchronisation problem if two users updated at the same time. Remember - this is NOT the sort of programming application that one user runs in isolation from another.

So we chose to use a directory of plain text files; the file name is also the name of the cookie that we offer to the individual browser, so that we can very quickly look up existing users. Within the file, each line is a field name followed by whatever the user entered into the field.

Here's what we mean:

$ ls
X1008403208_870 X1008403644_869 X1008403791_868 X1008403867_870 X1008404025_865 X1008404278_870
$ pwd
/magpie/www/html/php/party
$ cat X*865
first1 Sylvia
first2 Hugh
last1 Fallows
last2 Potter
coming1 yes
coming2 yes
email s.fallows@here.net
dishtype dessert
town birmingham
dish Brandy Snaps and custard
$

There's now no synchronisation problem - even if a lot of users are on the site at the same time, each is working on his / her own file, and the overall report page that's provided will treat other user's pages as "read only".

For extended applications, this scheme works very well too. For example, if you're running a shopping cart application one of the problems is knowing when someone's put something in their cart but then gone away from the site. With individual files, a loop that examines each file in a directory and deletes old files (abandoned carts) that haven't been modified for - say - 4 hours will do all the bookkeeping that you'll need.

ORIGINAL GENERATION OF THE HTML

The HTML pages in this example are much more complete than the examples in our other training modules; this is a full, working example that was used to meet a real life requirement.

Whilst we could have "hand coded" the HTML, these days many software packages ranging from Microsoft Word through Dreamweaver will do the job for you ... BUT they don't understand PHP. The quality of the HTML generated can also be variable, and some software packages produce code that's hard to edit.

For this job, we chose to use Dreamweaver. It's a good package for developing web pages with quality HTML, including forms and tables; the field names and parameters aren't necessarily exactly what we want, but we come back and edit the HTML manually later. Where we use Dreamweaver to develop a response page, we write the original artwork just to contain a recognised string of text which we then substitute with an appropriate piece of PHP.

Here's an example of a piece of code that was generated by Dreamweaver, but we replaced the body of the table cell with the echoing out of a PHP array element:

<td>
  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Main
    Course<br>
    (Vegetarian)</b><br>
    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <hr noshade size="1" align="center">
    <?php echo $dishlist["mainveg"] ; ?>
    </font></div>
</td>

FULL LISTING OF CODE

<?php
if ($new or ! $beenherebefore) {
        $needcookie = 1;
        $oldie = 1;
} else {
        if ($update) {
                $oldie = 2;
        } else {
                $oldie = 3;
        }
}

####################################

if (eregi('Submit.*enter',$Submit)) {
        # Submit and enter site selected. Need to update the user's entry?
        if ($first1 == "" and $last1 == "" and $coming1 == "" and
                $first2 == "" and $last2 == "" and $coming2 == "" and
                $email != "") {
        # relogin - need to look around for their email address!
                $remail = $email;
                $email = "";

        } else {

        # Potentially valid information - save it!

        $where = fopen("./party/$beenherebefore","w");
        fputs($where,"first1 $first1\n");
        fputs($where,"first2 $first2\n");
        fputs($where,"last1 $last1\n");
        fputs($where,"last2 $last2\n");
        fputs($where,"coming1 $coming1\n");
        fputs($where,"coming2 $coming2\n");
        fputs($where,"email $email\n");
        fputs($where,"dishtype $dishtype\n");
        fputs($where,"town $town\n");
        fputs($where,"dish $dish\n");
        fclose ($where);

        }
}

#############################################################################

# Go through all the files and analyse

$handle = opendir("./party");

while (($file = readdir ($handle)) != false) {
        if (ereg('^\.',$file)) continue;
        $where = fopen("./party/$file","r");
        while ($line = fgets($where,256)) {
                eregi('^([a-z0-9]+) (.*).$',$line,$bits);
                $person[$bits[1]] = $bits[2];
                }
        if ($person{"email"} == $remail) { # good relogin, no cookie
                $beenherebefore = $file;
                $needcookie = 1;
                }
        if ($beenherebefore == $file and $new != 1) {
                $first1 = $person{"first1"};
                $last1 = $person{"last1"};
                $coming1 = $person{"coming1"};
                $first2 = $person{"first2"};
                $last2 = $person{"last2"};
                $coming2 = $person{"coming2"};
                $email = $person{"email"};
                $dishtype = $person{"dishtype"};
                $town = $person{"town"};
                $dish = $person{"dish"};
                }
# Do the various counter works ...

        $p1 = $person{"first1"}." ".$person{"last1"}."<BR>";
        $p2 = $person{"first2"}." ".$person{"last2"}."<BR>";
        if ($person{"coming1"} == "yes") {
                $definite .= $p1;
                }
        if ($person{"coming1"} == "maybe") {
                $unsure .= $p1;
                }
        if ($person{"coming1"} == "no") {
                $surenot .= $p1;
                }
        if ($person{"first2"} != "" or $person{"last2"} != "") {
        if ($person{"coming2"} == "no") {
                $surenot .= $p2;
                }
        if ($person{"coming2"} == "yes") {
                $definite .= $p2;
                }
        if ($person{"coming2"} == "maybe") {
                $unsure .= $p2;
                }
        }

        $mystat = "";
        if ($coming1 == "yes") {
                $mystat = "You are a <b>definite</b> attendee<BR>";
                }
        if ($coming1 == "maybe") {
                $mystat = "You are a <b>possible</b> attendee<BR>";
                }
        if ($coming1 == "no") {
                $mystat = "You are <b>not attending</b><BR>";
                }

# Dishes - only those who are definite ...

        $bringing = "";

        if ($coming1 == "yes") {
                $mdt = ucfirst($dishtype);
                $bringing = "You are bringing a <b>$mdt</b> called <b>$dish</b><BR>";
                }

        if ($person{"coming1"} == yes) {
                $dt = $person{"dishtype"};
                $dishcount[$dt]++;
                $dishlist[$dt] .= "<img src=button.gif lowsrc=space.gif width=6 height=6> <b>".$person{"dish"}."</b> made by ".$person{"first1"}." ".
                        $person{"last1"}."<BR>";
                }
                

# Travel

        $fromplace = "";

        if ($coming1 != "no") {
                $tr = ucfirst($town);
                $fromplace = "You are coming from near to <b>$tr</b><BR>";
                }

# Companion

        $sother = "";
        if ($coming2 == "yes") {
                $sother = "You will be accompanied by <b>$first2 $last2</b><BR>";
                }
        if ($coming2 == "maybe") {
                $sother = "You <i>might</i> be accompanied by <b>$first2 $last2</b><BR>";
                }

        $fn .= "$beenherebefore $file $coming1<BR>";


        }

closedir ($handle);

$unsure or $unsure = "[empty list]<br>";
$surenot or $surenot = "[empty list]<br>";
$dishlist["starter"] or $dishlist["starter"] = "[empty list]<br>";
$dishlist["mainmeat"]or $dishlist["mainmeat"] = "[empty list]<br>";
$dishlist["mainveg"] or $dishlist["mainveg"] = "[empty list]<br>";
$dishlist["vegetable"]or $dishlist["vegetable"] = "[empty list]<br>";
$dishlist["dessert"] or $dishlist["dessert"] = "[empty list]<br>";

$wewant = ""; $ndc = 0;
uksort($dishlist,stln);

foreach ($dishlist as $k => $v) {
        if ($ndc == 0) { $wewant .= "We could REALLY do with a <b>$k</b><BR>"; }
        if ($ndc == 1) { $wewant .= "It would also be great if you provided a $k<BR>";}
        if ($ndc == 2) { $wewant .= "A $k would be welcome<BR>";}
        if ($ndc == 3) { $wewant .= "We have quite a few ${k}s promised already ";}
        if ($ndc == 4) { $wewant .= "and there's quite a few ${k}s too.<BR>";}
        $ndc++;
        }

function stln($a,$b) {
        global $wewant;
        global $dishcount;
        $r = $dishcount[$a] - $dishcount[$b];
        return ($r);
        }

if ($oldie == 3 and $email == "") {
        $fault = "<H2>We Don't know you. Please complete your name at least</H2>";
        $email = $remail;
        $oldie = 1;
        }
if ($needcookie) {
$when = $beenherebefore;
if ($when == "") $when = "X".time()."_".getmypid();
setcookie("beenherebefore",$when,time()+31449600);
}



if ($oldie < 3) {
################## Log in Page ######################
?>
<html>
<head>
<title>December 9, 2001</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFF99" text="#000000" link="#000000" vlink="#999999" alink="#FF0000" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
          <form action=<?php echo $PHP_SELF; ?> method="post">
                  <td align="left" valign="top"><img src="door.jpg" lowsrc="space.gif" alt="Welcome" border="0" width="1" height="1"><img src="ribbon.jpg" width="80" height="55" lowsrc="space.gif"></td>
    <td width="12" align="left"><img src="space.gif" width="12"></td>
    <td align="left" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td colspan="12"><font size="5" face="Times New Roman, Times, serif" color="#E45642"><i><b>A
              Little AmExpats Get-Together</b></i></font>
              <hr>
            </td>
          </tr>
          <tr>
            <td colspan="12">
              <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
                This site has been automated for your convience. We ask you to
                log in the first time; next time you shouldn't have to again if
                you login from the same computer each time.*</font>
                <?php echo $fault ; ?>
                <hr>
              </div>
            </td>
          </tr>
          <tr valign="middle" align="left">
            <td bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">What's
              your name?</font></b></font></td>
            <td nowrap bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>first
              <input type="text" name="first1" size="12" value="<?php echo $first1;?>">
              </b></font></td>
            <td nowrap bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>last
              <input type="text" name="last1" size="12" value="<?php echo $last1;?>">
              </b></font></td>
            <td nowrap bgcolor="#FFFFFF">
              <input type="radio" name="coming1" value="yes" <?php echo (($coming1=="yes")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">coming</font></td>
            <td nowrap bgcolor="#FFFFFF">
              <input type="radio" name="coming1" value="no" <?php echo (($coming1=="no")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">not
              coming</font></td>
            <td nowrap colspan="7" bgcolor="#FFFFFF">
              <input type="radio" name="coming1" value="maybe" <?php echo (($coming1=="maybe")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">unsure</font></td>
          </tr>
          <tr valign="middle" align="left">
            <td colspan="12" bgcolor="#FFFFFF">
              <hr>
            </td>
          </tr>
          
          <tr valign="middle" align="left">
            <td bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">What's
              your email address?</font></b></font></td>
            <td nowrap colspan="11" bgcolor="#FFFFFF">
              <input type="text" name="email" size="36" value="<?php echo $email;?>">
            </td>
          </tr>
          <tr>
            <td colspan=12>
              <hr>
              <font size="3"><i><font face="Times New Roman, Times, serif">Fill
              in the remaining only if you have decided you are definitely coming.</font></i></font>
              <hr>
            </td>
          </tr>
          <tr valign="middle" align="left">
            <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">What's
              your partner's name?</font></b></font></td>
            <td nowrap><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>first
              <input type="text" name="first2" size="12" value="<?php echo $first2;?>">
              </b></font></td>
            <td nowrap><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>last
              <input type="text" name="last2" size="12" value="<?php echo $last2;?>">
              </b></font></td>
            <td nowrap>
              <input type="radio" name="coming2" value="yes" <?php echo (($coming2=="yes")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">coming</font></td>
            <td nowrap>
              <input type="radio" name="coming2" value="no" <?php echo (($coming2=="no")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">not
              coming</font></td>
            <td nowrap colspan="7">
              <input type="radio" name="coming2" value="maybe" <?php echo (($coming2=="maybe")?"CHECKED":""); ?>>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2">unsure</font></td>
          </tr>
          <tr valign="middle" align="left">
            <td colspan="12">
              <hr>
            </td>
          </tr>
          
          <tr valign="top" align="left">
            <td colspan="3"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">If
              you are bringing something, what?</font></b>
              <select name="dishtype">
                <option>--choose a type of potluck dish--</option>
                <option value="starter" <?php echo (($dishtype=="starter")?"SELECTED":""); ?>>Appetizer/Starter</option>
                <option value="mainmeat" <?php echo (($dishtype=="mainmeat")?"SELECTED":""); ?>>Main Course - Meat-based</option>
                <option value="mainveg" <?php echo (($dishtype=="mainveg")?"SELECTED":""); ?>>Main Course - Vegetarian</option>
                <option value="vegetable" <?php echo (($dishtype=="vegetable")?"SELECTED":""); ?>>Accompanying Vegetable</option>
                <option value="dessert" <?php echo (($dishtype=="dessert")?"SELECTED":""); ?>>Dessert</option>
              </select>
                <br><br><?php echo $wewant; ?>
</font>
            </td>
            <td nowrap colspan="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">What's
              the dish called?</font></b></font></td>
            <td nowrap colspan="7">
              <input type="text" name="dish" size="20" value="-<?php echo $dish;?>">
            </td>
          </tr>
          <tr>
            <td colspan=12><br>
<font face="Times New Roman, Times, serif" size="2"><i>Note:
              You can certainly bring more than one item. This is just to make
              sure not everyone brings the same thing.</i></font> </td>
          </tr>
          <tr valign="middle" align="left">
            <td colspan="12">
              <hr>
            </td>
          </tr>
          
          <tr valign="middle" align="left">
            <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font color="E45642">What
              area are you coming from?</font></b></font></td>
            <td nowrap colspan="11">
              <select name="town">
                <option>--pick town or city nearest to you--</option>
                <option value="birmingham" <?php echo(($town=="birmingham")?"SELECTED":""); ?>>Birmingham</option>
                <option value="bristol" <?php echo(($town=="bristol")?"SELECTED":""); ?>>Bristol</option>
                <option value="gloucester" <?php echo(($town=="gloucester")?"SELECTED":""); ?>>Gloucester</option>
                <option value="london" <?php echo(($town=="london")?"SELECTED":""); ?>>London</option>
                <option value="manchester" <?php echo(($town=="manchester")?"SELECTED":""); ?>>Manchester</option>
                <option value="oxford" <?php echo(($town=="oxford")?"SELECTED":""); ?>>Oxford</option>
                <option value="plymouth" <?php echo(($town=="plymouth")?"SELECTED":""); ?>>Plymouth</option>
                <option value="reading" <?php echo(($town=="reading")?"SELECTED":""); ?>>Reading</option>
                <option value="salisbury" <?php echo(($town=="salisbury")?"SELECTED":""); ?>>Salisbury</option>
                <option value="swindon" <?php echo(($town=="swindon")?"SELECTED":""); ?>>Swindon</option>
              </select>
            </td>
          </tr>
          <tr valign="middle" align="left">
            <td colspan="12">
              <hr>
            </td>
          </tr>
          <tr valign="middle" align="left">
            <td colspan="12">
              <input type="submit" name="Submit" value="Submit this information and enter site">
            </td>
          </tr>
          <tr>
            <td colspan=12>
              <hr>
            </td>
          </tr>
          <tr>
            <td colspan="12"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">*
              You're really our guinea pig. We're testing out several PHP, Perl,
              JavaScript methods as part of our business. This just seemed like
              a cool way to do it.</font></td>
          </tr>
        </table>
          
      </form>
    <td valign="top"><img src="space.gif" width="6"> </td>

        
        
        
  </tr>
</table>

</body>
</html>

<?php
####################################
} else {
###################### Results Page ######################
?>

<html>
<head>
<title>December 9, 2001</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFF99" text="#000000" link="#000000" vlink="#999999" alink="#FF0000" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" align="left" valign="top" bgcolor="#FFFFFF">
      <p><img src="door.jpg" lowsrc="space.gif" alt="Welcome" border="0" width="200" height="470" usemap="#Map">
        <br clear=all>
      <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
          <td align="center" valign="top">
            <div align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
              <b>Hosts:</b><br>
              Graham and Lisa Ellis<br>
              404, The Spa<br>
              Melksham, Wiltshire<br>
              SN12 6QL<br>
              (01225) 709 638</font><br></div>
          </td>
  </tr>
</table>
    </td>
    <td width="12" align="left"><img src="space.gif" width="12"></td>
    <td align="left" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
        <tr>
          <td colspan="8" nowrap>
            <div align="center"> <br>
              <p><font face="Times New Roman, Times, serif" size="5" color="#FF3300"><i><b>Sunday,
                December 9, 2001</b></i></font><br>
                <font size="2" color="#000000" face="Verdana, Arial, Helvetica, sans-serif">Gathering
                anytime from 11:00 am<br>
                Lunch tossed on serving table 1:00 pm-ish</font></p>
            </div>
          </td>
        </tr>
        <tr>
          <td colspan="8"><font face="Times New Roman, Times, serif" size="3"><b>Welcome
            back
            <?php echo "$first1"; ?>
            </b></font></td>
        </tr>
        <tr>
          <td><font face="Times New Roman, Times, serif" size="2"><i>Follow <a href=<?php echo $PHP_SELF; ?>?update=1>this
            link</a> if you want to change your details</i></font></td>
          <td colspan="-3">&nbsp;</td>
          <td><font face="Times New Roman, Times, serif" size="2"><i>Follow <a href=<?php echo $PHP_SELF; ?>?new=1>this
            link</a> if you are NOT
            <?php echo "$first1 $last1"; ?>
            </i></font></td>
          <td colspan="-3">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="8">
            <hr>
          </td>
        </tr>
        <tr>
          <td colspan="8">
            <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b>Your
              current details:</b><br>
              <?php echo $mystat; ?>
              <?php echo $bringing; ?>
              <?php echo $fromplace; ?>
              <?php echo $sother; ?>
              </font> </div>
          </td>
        </tr>
        <tr>
          <td colspan="8">
            <hr>
            <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b>Who's
              coming?</b></font></div>
          </td>
        </tr>
        <tr>
          <td colspan=8>
            <table width="100%" border="1" cellspacing="0" cellpadding="0">
              <tr align="center" valign="top">
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Definite</b><br>
                    <hr noshade size="1">
                    <?php echo $definite; ?>
                    </font></div>
                </td>
                <td><img src="space.gif" width="6"></td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Maybe</b><br>
                    <hr noshade size="1">
                    <?php echo $unsure; ?>
                    </font></div>
                </td>
                <td><img src="space.gif" width="6"></td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>No</b><br>
                    <hr noshade size="1">
                    <?php echo $surenot; ?>
                    </font></div>
                </td>
              </tr>
            </table>
        </tr>
        <tr>
          <td colspan="8">
            <hr>
            <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b>What's
              everyone bringing?</b></font></div>
          </td>
        </tr>
        <tr>
          <td colspan="8">
            <table width="100%" border="1" cellspacing="0" cellpadding="0">
              <tr align="center" valign="top">
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Appetizer<br>
                    (Starter)</b><br>
                    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
                    <hr noshade size="1" align="center">
                    <?php echo $dishlist["starter"] ; ?>
                    </font></div>
                </td>
                <td>
                  <div align="center"><img src="space.gif" width="6"></div>
                </td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Main
                    Course<br>
                    (Meat-based)</b><br>
                    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
                    <hr noshade size="1" align="center">
                    <?php echo $dishlist["mainmeat"] ; ?>
                    </font></div>
                </td>
                <td>
                  <div align="center"><img src="space.gif" width="6"></div>
                </td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Main
                    Course<br>
                    (Vegetarian)</b><br>
                    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
                    <hr noshade size="1" align="center">
                    <?php echo $dishlist["mainveg"] ; ?>
                    </font></div>
                </td>
                <td>
                  <div align="center"><img src="space.gif" width="6"></div>
                </td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Accompanying<br>
                    Vegetable</b><br>
                    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
                    <hr noshade size="1" align="center">
                    <?php echo $dishlist["vegetable"] ; ?>
                    </font></div>
                </td>
                <td>
                  <div align="center"><img src="space.gif" width="6"></div>
                </td>
                <td>
                  <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Dessert<br>
                    (Sweet/Pudding)</b><br>
                    </font> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
                    <hr noshade size="1" align="center">
                    <?php echo $dishlist["dessert"] ; ?>
                    </font></div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="8">
            <div align="center">
              <p><br>
                <font face="Times New Roman, Times, serif" size="2"><i>Non-alcoholic
                drinks (soft drinks, coffee, tea, water), plates, glasses and
                cutlery will be supplied.</i></font></p>
              <p><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b>Other
                things to bring:</b></font><br>
                <font face="Verdana, Arial, Helvetica, sans-serif" size="3">Small
                bit of cash</font><br>
                <font size="2" face="Times New Roman, Times, serif"><i>(there
                will be a raffle [5 pounds each ticket] to help defray ISP costs for the AmericanExpats Page)</i></font><br>
                <font face="Verdana, Arial, Helvetica, sans-serif" size="3">Small
                wrapped gift</font><br>
                <font size="2" face="Times New Roman, Times, serif"><i>(there
                will be a gift exchange [one gift per couple/spend not more than 10 pounds])</i></font><br>
                <font face="Verdana, Arial, Helvetica, sans-serif" size="3">BYOB</font><br>
                <font size="2" face="Times New Roman, Times, serif"><i>(If you want alcohol, please bring your own, or enough to share!)</i></font></p>
            </div>
          </td>
        </tr>
        <tr>
          <td colspan="8">&nbsp;</td>
        </tr>
      </table>
          
    <td valign="top"><img src="space.gif" width="6"> </td>
        <td valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
          <td align="center" valign="top">
            <div align="center"><br>
<img src="ribbon.jpg" width="80" height="55" lowsrc="space.gif"></div>
            <div align="left"><br>
              <a href="directions.html"><img src="button.gif" width="12" height="12" lowsrc="space.gif" alt="button" border="0" align="absmiddle"></a>
              <font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="directions.html">Directions</a><br>
              <br>
              <a href="staying.html"><img src="button.gif" width="12" height="12" lowsrc="space.gif" alt="button" border="0" align="absmiddle"></a>
              <a href="staying.html">Local Accommodation</a><br><br><br></font></div>
              
            <div align="center"><a href="mailto:lisa@wellho.net"><img src="envelope.gif" lowsrc="space.gif" width="30" height="19" border=0></a><br><br>
              <i><font face="Times New Roman, Times, serif" size="2">Email <a href="mailto:lisa@wellho.net">Lisa</a>
              for more information.<br>
Please also email if you are planning to bring children. Let me know how many and what their ages are.</font></i></div>
          </td>
  </tr>
</table>



    </td>
        
        
        
  </tr>
</table>

<map name="Map">
  <area shape="poly" coords="34,301,91,382,154,343,95,261,33,301" alt="You are cordially invited to our home -- Lisa &amp; Graham Ellis" title="You are cordially invited to our home -- Lisa &amp; Graham Ellis" href="#">
</map>
</body>
</html>



<?php
####################################

}

?>


See also PHP Training courses

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

PHP - Complete example - Registering for a get-together

resource index - PHP
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/php-comp ... ether.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard