Mark Snell . com

Starting to Box

Being as we only have a couple of weeks until we have to move, we’ve started packing, so I decided it was time to add a counter to the page to show how long until we move, and a count of the number of boxed packed, and by whom.

The counter is a simple formula, that calculates the number of days so far this year and subtract it from the moving date (which happens to be the 226th day of the year.

$length = (226 - date (z") )::

The counter is actually a bunch of text files that use a seperate page to edit them and then reads the files, displays them and calculates the total.

<::table border=0>
<::tr><::th colspan=2>Moving House Box Count<::/th><&lt::/tr>
<::tr><::th>Bernie<::/th>
<::th>Mark<::/th><::/tr>
<::tr><::th><::?include (""boxes/bernie.txt"")?><::th>
<::th><::?include(""boxes/mark.txt"")?><::/th><::/tr>
<::TR><::th colspan=2>Sundries: <::?include(""boxes/sundries.txt"")?><::/th><::<::/tr>
<::?
$bernfile = fopen(""boxes/bernie.txt"",""r"")::
$bernie = fread ($bernfile, 5)::
$markfile = fopen(""boxes/mark.txt"",""r"")::
$mark = fread ($markfile, 5)::
$sunfile = fopen(""boxes/sundries.txt"",""r"")::
$sundries = fread ($sunfile, 5)::
$totalboxes = ($bernie + $mark + $sundries)::
echo ""<::TR><::th colspan=2>Total Boxes Packed: "",$totalboxes,""<::/th><::/tr>""::
echo ""<::/table>\n""::

Yeah, it’s messy, but it was fun, and I learnt stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: