From Networks & Transactions 1

Assignments: Assignment2Tom

Forecast of death

Online version: http://ernie.art.yale.edu/~tommanning/weathertest.php

Source code (request page):

<html>

<head>
        <title>
                        47 FACES OF DEATH
        </title>
</head>


<body background="bg.gif" leftmargin="0" topmargin="0" rightmargin="0">

<table width="100%" cellpadding="0" cellspacing="0" bgcolor="black">

        <tr>
                <td height="18px"></td>
        </tr>
       
        <tr>
                <td>   
                        <p><font size="2" face="Arial" color="white"><center>
       
                        <form action="tom2.php" method="get">


                        Enter your zip code
                        <input type="text" name="zip" size="5">
                        <input type="submit" name="submit" value="Go">
                </font></p>     

                </form>
       
                </td>
        </tr>
       
        <tr>
                <td height="4px">
        </tr>
       
        <tr>
                <td height="1px" bgcolor="#474747"></td>
        </tr>
       
</table>


</body>




</html>

Source code (response page):

<?php
//load the XML file RSS feed
//first load file as straight data
$zip = $_REQUEST["zip"];
// echo "$zip";
$xmlContents = file_get_contents("http://xml.weather.yahoo.com/forecastrss?p=$zip");
$xmlContents = str_replace("yweather:", "", $xmlContents);
$xmlContents = str_replace("geo:", "", $xmlContents);
//Now load the string into SimpleXML
$xml = simplexml_load_string($xmlContents);

//      FOR CONVENIENCE, LOAD DATA WE CARE ABOUT INTO VARIABLES
// <channel> node contains some of the info
        $channel = $xml->channel;
       
        // Location name: only the attributes are meaningful
        $location = $channel->location;
        $city = $location["city"]; // e.g. "New Haven"
        $region = $location["region"]; // e.g. "CT"
        $country = $location["country"]; // e.g. "US"
       
        // Units info: only the attributes are meaningful
        $units = $channel->units;
        $tempUnits = $units["temperature"]; // e.g. "F"
        $distanceUnits = $units["distance"]; // e.g. "mi"
        $pressureUnits = $units["pressure"]; // e.g. "in"
        $speedUnits = $units["speed"]; // e.g. "mph"
       
        // Wind data: only the attributes are meaningful
        $wind = $channel->wind;
        $windChill = $wind["chill"]; // e.g. "57"
        $windDir = $wind["direction"]; // e.g. "350"
        $windSpeed = $wind["speed"]; // e.g. "7"
       
        // Atmosphere data: only the attributes are meaningful
        $atmosphere = $channel->atmosphere;
        $humidity = $atmosphere["humidity"]; // e.g. "93";
        $visibility = $atmosphere["visibility"]; // e.g. "1609";
        $pressure = $atmosphere["pressure"]; // e.g. "30.12";
        $rising = $atmosphere["rising"]; // e.g. "0";
       
        // Astronomy data: only the attributes are meaningful
        $astronomy = $channel->astronomy;
        $sunrise = $astronomy["sunrise"]; // e.g. "7:02 am";
        $sunset = $astronomy["sunset"]; // e.g. "4:51 pm";

        // <item> node is within the <channel> node, contains additional info
        $item = $channel->item;
       
        $lat = $item->lat; // Latitude, e.g. "37.39"
        $long = $item->long; // Longitude, e.g. "122.03"
       
        // Condition data: only the attributes are meaningful
        $condition = $item->condition;
        $conditionText = $condition["text"]; // e.g. "Mostly Cloudy" (corresponds to code below)
        $conditionCode = $condition["code"]; // e.g. "26" (47 possibilities)
        $temp = $condition["temp"]; // e.g. 57
        $date = $condition["date"]; // e.g. Tue, 29 Nov 2005 3:56 pm PST
       
       
        // ----------set punishments------------------
if ( $temp <='19') {
$tempWarning = "The temperature is $temp degrees. Exposure to such extreme cold quickly leads to serious damage of the body and death. Frostbite, hypothermia, numbness, memory loss, and extreme cramps are caused by low temperatures. Be cautious.";
}
if ( $temp >= '20' && $temp<='33') {
$tempWarning = "The temperature is $temp degrees. Exposure to extreme freezing conditions leads to frostbite, extreme muscle cramps, numbness, memory loss, hypothermia and damage of the immune system. Be cautious.";
}      
if ( $temp >= '34' && $temp<='50') {
$tempWarning = "The temperature is $temp degrees. Exposure to cold conditions weakens the immune system and spreads disease. It is best to stay away from large groups of people in such temperature. Be cautious.";
}
if ( $temp >= '51' && $temp<='89') {
$tempWarning = "The temperature is $temp degrees, which is ideal for growth of and spread of Escherichia coli, Bacillus anthracis, Clostridium botulinum and monoceptis. Be cautious.";
}
if ( $temp >= '90') {
$tempWarning = "The temperature is $temp degrees. Continued exposure to such heat leads to dehydration, memory loss, attention deficits, sleep disorders, numbness, dizziness, irritability, fatigue, weakness, muscle spasms, and death. Be cautious.";
}



// ---------- Scroll Colors
if ( $conditionCode == '0' && $conditionCode <='4') {
$color = '#FF0000';
}      
if ( $conditionCode >= '5' && $conditionCode <='18') {
$color = '#FA4D00';
}      
if ( $conditionCode >= '19' && $conditionCode <='30') {
$color = '#FFCC00';
}
if ( $conditionCode >= '31' && $conditionCode <='34') {
$color = '#FF0000';
}
if ( $conditionCode =='35') {
$color = '#FA4D00';
}
if ( $conditionCode =='36') {
$color = '#FF0000';
}
if ( $conditionCode >= '37' && $conditionCode <='39') {
$color = '#FF0000';
}
if ( $conditionCode >= '40' && $conditionCode <='43') {
$color = '#FA4D00';
}
if ( $conditionCode =='44') {
$color = '#FFCC00';
}
if ( $conditionCode =='45') {
$color = '#FF0000';
}
if ( $conditionCode =='46') {
$color = '#FA4D00';
}
if ( $conditionCode =='47') {
$color = '#FF0000';
}

if ( $conditionCode == '0') {
$message1 = "Warning for $city: Tornado conditions are highly dangerous. Tornados create high winds that may hurl lethal objects, and destroy life and property. Tornados can appear without any warning. It is best to find an underground environment to evacuate to immediately.";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '1') {
$message1 = "Warning for $city: Dangers surrounding tropical storms are severe and numerous. High wind speeds cause lethal conditions, and torrential rain can cause flash floods. It is best to evacuate your area immediately.";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '2') {
$message1 = "Warning for $city: Dangers surrounding hurricanes are severe, numerous, and very lethal. High wind speeds cause lethal conditions, and torrential rain can cause flash floods. It is best to evacuate immediately.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '3') {
$message1 = "Warning for $city: Thunderstorms are highly lethal. Lightning leads to more annual deaths than those caused by tornadoes or hurricanes. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '4') {
$message1 = "Warning for $city: Thunderstorms are highly lethal. Lightning leads to more annual deaths than those caused by tornadoes or hurricanes. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '5') {
$message1 = "Warning for $city: Rain mixed with snow is extremely dangerous. Ice that is invisible on smooth surfaces forms and consequently, people are often unaware of its presence. Sidewalks become extremely slick when covered with freezing rain, causing many people to slip and injure themselves, often fatally. Automobile accidents are more likely to occur during slick and icy conditions such as these. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '6') {
$message1 = "Warning for $city: Rain mixed with sleet is very dangerous. Ice that is invisible on smooth surfaces forms and consequently, people are often unaware of its presence. Sidewalks become extremely slick when covered with freezing rain, causing many people to slip and injure themselves, often fatally. Automobile accidents are more likely to occur during slick and icy conditions such as these. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '7') {
$message1 = "Warning for $city: Snow mixed with sleet is extremely dangerous. Ice that is invisible on smooth surfaces forms, often leading to fatal road and sidewalk accidents. Becoming wet in such cold conditions often leads to hypothermia, frostbite, and a weakened immune system. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '8') {
$message1 = "Warning for $city: Freezing drizzle is very dangerous. Ice that is invisible on smooth surfaces forms and consequently, people are often unaware of its presence. Sidewalks become extremely slick when covered with freezing drizzle, causing many people to slip and injure themselves, often fatally. Automobile accidents are more likely to occur during slick and icy conditions such as these. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '9') {
$message1 = "Warning for $city: Drizzly conditions are ideal for the spread of disease. Wet conditions often weaken the immune system, and aerobiologists have concluded that drizzle is the ideal precipitation for transmitting the deadly airborne bacteria Escherichia coli. Drizzle also spreads water-borne organisms and viruses directly to the respiratory system.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '10') {
$message1 = "Warning for $city: Freezing rain is very dangerous. Ice that is invisible on smooth surfaces forms and consequently, people are often unaware of its presence. Sidewalks become extremely slick when covered with freezing rain, causing many people to slip and injure themselves, often fatally. Automobile accidents are more likely to occur during slick and icy conditions such as these. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '11') {
$message1 = "Warning for $city: Rain showers are ideal for the spread of airborne pollution to the body, which damage the immune system. Algae and other small water-borne organisms are often contained in rain droplets, and are the cause of many diseases. Avoid direct ingestion of any precipitation.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '12') {
$message1 = "Warning for $city: Rain showers are ideal for the spread of airborne pollution to the body, which damage the immune system. Algae and other small water-borne organisms are often contained in rain droplets, and are the cause of many diseases. Avoid direct ingestion of any precipitation.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '13') {
$message1 = "Warning for $city: Snow flurries can lead to accidents due to slipping or disorientation, which will cause injury or death. Be aware that cold weather challenges the immune system, leading to higher possibility of infection and illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '14') {
$message1 = "Warning for $city: Snow showers can lead to accidents due to slipping or temporary snow-blindness, which will cause injury or death. Be aware that cold weather challenges the immune system, leading to higher possibility of infection and illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '15') {
$message1 = "Warning for $city: Disorientation and snow-blindness often occur from blowing snow. Many fatal automobile and pedestrian accidents are due to problems caused by this dangerous weather. Frostbite and severe damage to the immune system are also possible.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '16') {
$message1 = "Warning for $city: Snow can lead to accidents due to slipping or temporary snow-blindness, which will cause injury or death. Be aware that cold weather challenges the immune system, leading to higher possibility of infection and illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '17') {
$message1 = "Warning for $city: Hail storms are dangerous and unpredictable. The United States suffers one billion dollars in annual damage due to hail, and many people annually die from underestimating the damage of hailstones. Do not ingest hailstones, the dust particles which they form around are often carcinogenic.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '18') {
$message1 = "Warning for $city: Sleet conditons are very dangerous. Ice that is invisible on smooth surfaces forms and consequently, people are often unaware of its presence. Sidewalks become extremely slick when covered from sleet, causing many people to slip and injure themselves, often fatally. Automobile accidents are more likely to occur during slick and icy conditions caused by sleet. All elderly people must stay inside in such conditions.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '19') {
$message1 = "Warning for $city: Dusty conditions lead to deadly accidents due to disorientation and ingestion of particulates. Dust carries soil that is infected with germs, and inhaled particulates are impossible to remove.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '20') {
$message1 = "Warning for $city: Foggy conditions are extremely dangerous. Deadly accidents are caused by disorientation, and aerobiologists have concluded that fog is ideal for transmitting algae and small water-borne organisms that inhabit clouds. Many of these organisms cause illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '21') {
$message1 = "Warning for $city: Hazy conditions are extremely dangerous. Deadly accidents are caused by disorientation, and aerobiologists have concluded that haze contains particles of pollution and small water-borne organisms.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '22') {
$message1 = "Warning for $city: Smoky conditions are extremely dangerous, it leads to permanent damage to the respiratory system. Smoke can lead to asphyxiation, choking, vomiting, and death.";
$message2 = "$tempWarning";
}


if ( $conditionCode == '23') {
$message1 = "Warning for $city: Blustery conditions can be an agent of spreading deadly germs, as well as airborne particles that may damage the eyes and respiratory system. Recent studies have shown windy days to be the ideal weather such as influenza, croup, and monoceptis.";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '24') {
$message1 = "Warning for $city: Windy conditions can be an agent of spreading deadly germs, as well as airborne particles that may damage the eyes and respiratory system. Recent studies have shown windy days to be the ideal weather such as influenza, croup, and monoceptis.";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '25') {
$message1 = "Warning for $city: Cold conditions quickly lead to hypothermia and frostbite. The immune system is weakened in such conditions, creating the spread of illness. Stay indoors and away from large groups of people.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '26') {
$message1 = "Warning for $city: Cloudy conditions are the cause of Seasonal Affective Disorder (SAD), a mood disorder which leads to suicide. Prolonged exposure to cloudy conditions heighten the risk of Seasonal Affecive Disorder.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '27') {
$message1 = "Warning for $city: Statistics show that cloudy nights generate the most crime due to darker conditions. It is best to stay inside during nights with cloudy weather.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '28') {
$message1 = "Warning for $city: Mostly cloudy days are dangerous due to the creation and evaporation of clouds, which spread algae and other small water-borne organisms that inhabit clouds. Exposure to Escherichia coli and Bacillus anthracis is very possible. Clouds are also the cause of Seasonal Affective Disorder (SAD), which leads to suicide.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '29') {
$message1 = "Warning for $city: Partly cloudy nights are known to be perfect conditions for major shifts in air circulation, bringing pollutants and particles to lower elevations. For respiratory protection, breathe through the nose, or with a filter over the mouth.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '30') {
$message1 = "Warning for $city: Partly cloudy days disseminate large amounts of dangerous airborne microbial matter such as Clostridium botulinum and monoceptis. This is due to the constant evaporation of clouds often caused under partly cloudy conditions. Avoid ingesting any water droplets formed in the outside environment.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '31') {
$message1 = "Warning for $city: Clear nights often create radical shifts in temperature, which are a challenge to the body. Be cautious of temperature variations, and be able to go indoors if any shifts are observed.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '32') {
$message1 = "Warning for $city: Sunny weather is ideal for government Chemtrail sprayings. Studies show chemtrails induce pneumonia-like respiratory problems, and eventually death. Prolonged exposure to the sun, no matter what temperature or elevation, causes cancer.";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '33') {
$message1 = "Warning for $city: During evenings with such weather, be especially aware of mid to low atmospheric formations. These are often made of pollution-ridden air particles which are known to cause cancer. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '34') {
$message1 = "Warning for $city: This weather is ideal for the transfer and refraction of harmful UV rays. Prolonged exposure to the sun, no matter what temperature or elevation, causes cancer. Be especially aware of the formation of mid to low atmospheric formations. These are often made of pollution-ridden, carcinogenic air particles. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '35') {
$message1 = "Warning for $city: The mixture of rain and hail leads to slick, invisible ice and many accidents. Do not ingest hialstones, because the particles they form around have been found to be carcinogenic. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '36') {
$message1 = "Warning for $city: Hot weather leads to dehydration, heatstroke, delirium, and nausea. Stay out of direct sun exposure at all times. Sun burns lead to weak immune systems and skin cancer. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '37') {
$message1 = "Warning for $city: Thunderstorms are highly lethal. Lightning leads to more annual deaths than those caused by tornadoes or hurricanes. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '38') {
$message1 = "Warning for $city: Thunderstorms are highly lethal. Lightning leads to more annual deaths than those caused by tornadoes or hurricanes. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode >= '39') {
$message1 = "Warning for $city: Thunderstorms are highly lethal. Lightning leads to more annual deaths than those caused by tornadoes or hurricanes. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '40') {
$message1 = "Warning for $city: Rain showers are ideal for the spread of airborne pollution to the body, which damage the immune system. Algae and other small water-borne organisms are often contained in rain droplets, and are the cause of many diseases. Avoid direct ingestion of any precipitation.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '41') {
$message1 = "Warning for $city: Heavy snow is extremely dangerous and leads to accidents due to excessive snow-blindness, black ice, and disorientation. The freezing, wet conditions caused by exposure heavy snow causes hyperthermia, frostbite, pneumonia, and croup.";
$message2 = "$tempWarning";
}


if ( $conditionCode == '42') {
$message1 = "Warning for $city: Snow showers can lead to accidents due to slipping or disorientation, which will cause injury or death. Be aware that cold weather challenges the immune system, leading to higher possibility of infection and illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode == '43') {
$message1 = "Warning for $city: Heavy snow is extremely dangerous and leads to accidents due to excessive snow-blindness, black ice, and disorientation. The freezing, wet conditions caused by exposure heavy snow causes hyperthermia, frostbite, pneumonia, and croup.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '44') {
$message1 = "Warning for $city: Partly cloudy days disseminate large amounts of dangerous airborne microbial matter such as Clostridium botulinum and monoceptis. This is due to the constant evaporation of clouds often caused under partly cloudy conditions. Avoid ingesting any water droplets formed in the outside environment.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '45') {
$message1 = "Warning for $city: Thundershowers are highly lethal. Heavy rain can be used to spread the deadly electrical discharge of lightning. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside. ";
$message2 = "$tempWarning";
}      

if ( $conditionCode == '46') {
$message1 = "Warning for $city: Snow showers can lead to accidents due to slipping or disorientation, which will cause injury or death. Be aware that cold weather challenges the immune system, leading to higher possibility of infection and illness.";
$message2 = "$tempWarning";
}

if ( $conditionCode >= '47') {
$message1 = "Warning for $city: Thundershowers are highly lethal. Heavy rain can be used to spread the deadly electrical discharge of lightning. Many, many more people are struck but survive with a variety of long-term, debilitating symptoms, including memory loss, attention deficits, sleep disorders, numbness, dizziness, stiffness in joints, irritability, fatigue, weakness, muscle spasms, depression, and an inability to sit for long. Do not go outside. ";
$message2 = "$tempWarning";
}      
       
       
        // <yweather:forecast> nodes are within the item nodes, one per each forecasted day. So this will be an array.
        $forecasts = $item->forecast;
       
                // ----- DISPLAY THE FORECAST

                $thisForecast = $forecasts[$forecastNum];
                $forecastDay = $thisForecast["day"];
                $forecastDate = $thisForecast["date"];
                $forecastLow = $thisForecast["low"];
                $forecastHigh = $thisForecast["high"];
                $forecastConditionText = $thisForecast["text"];
                $forecastConditionCode = $thisForecast["code"];
               
        //      echo "You will be killed in $city by $conditionText because of $messageLet.";
       
       




       
       
        ?>






<html>

<head>
        <title>
                        47 FACES OF DEATH
        </title>
       
        <script language="JavaScript1.2">
                <!--
               
                // Simple marquee script
                // By Mark Wilton-Jones 25/6/2005
                // Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
               
                // Wherever you want to display a marquee, use:
                //  <div class="dmarquee"><div><div>Marquee text</div></div></div>
               
                // You can create multiple marquees if needed.
               
                // If you want to style the marquees, style the outermost div (the script uses the inner
                //  divs to avoid box model problems). You can use multiple classes to the outer div to
                //  facilitate additional styling:
                //  <div class="dmarquee myclass"><div><div>Marquee text</div></div></div>
               
                // To stop the marquees manually, run doMStop();
                // You can also restart them using doDMarquee();
               
                var oMarquees = [], oMrunning,
                        oMInterv =        20,     //interval between increments
                        oMStep =          1,      //number of pixels to move between increments
                        oStopMAfter =     0,      //how many seconds should marquees run (0 for no limit)
                        oResetMWhenStop = false//set to true to allow linewrapping when stopping
                        oMDirection =     'left'; //'left' for LTR text, 'right' for RTL text
                               
                function doMStop() {
                        clearInterval(oMrunning);
                        for( var i = 0; i < oMarquees.length; i++ ) {
                                oDiv = oMarquees[i];
                                oDiv.mchild.style[oMDirection] = '0px';
                                if( oResetMWhenStop ) {
                                        oDiv.mchild.style.cssText = oDiv.mchild.style.cssText.replace(/;white-space:nowrap;/g,'');
                                        oDiv.mchild.style.whiteSpace = '';
                                        oDiv.style.height = '';
                                        oDiv.style.overflow = '';
                                        oDiv.style.position = '';
                                        oDiv.mchild.style.position = '';
                                        oDiv.mchild.style.top = '';
                                }
                        }
                        oMarquees = [];
                }
                function doDMarquee() {
                        if( oMarquees.length || !document.getElementsByTagName ) { return; }
                        var oDivs = document.getElementsByTagName('div');
                        for( var i = 0, oDiv; i < oDivs.length; i++ ) {
                                oDiv = oDivs[i];
                                if( oDiv.className && oDiv.className.match(/\bdmarquee\b/) ) {
                                        if( !( oDiv = oDiv.getElementsByTagName('div')[0] ) ) { continue; }
                                        if( !( oDiv.mchild = oDiv.getElementsByTagName('div')[0] ) ) { continue; }
                                        oDiv.mchild.style.cssText += ';white-space:nowrap;';
                                        oDiv.mchild.style.whiteSpace = 'nowrap';
                                        oDiv.style.height = oDiv.offsetHeight + 'px';
                                        oDiv.style.overflow = 'hidden';
                                        oDiv.style.position = 'relative';
                                        oDiv.mchild.style.position = 'absolute';
                                        oDiv.mchild.style.top = '0px';
                                        oDiv.mchild.style[oMDirection] = oDiv.offsetWidth + 'px';
                                        oMarquees[oMarquees.length] = oDiv;
                                        i += 2;
                                }
                        }
                        oMrunning = setInterval('aniMarquee()',oMInterv);
                        if( oStopMAfter ) { setTimeout('doMStop()',oStopMAfter*1000); }
                }
                function aniMarquee() {
                        var oDiv, oPos;
                        for( var i = 0; i < oMarquees.length; i++ ) {
                                oDiv = oMarquees[i].mchild;
                                oPos = parseInt(oDiv.style[oMDirection]);
                                if( oPos <= -1 * oDiv.offsetWidth ) {
                                        oDiv.style[oMDirection] = oMarquees[i].offsetWidth + 'px';
                                } else {
                                        oDiv.style[oMDirection] = ( oPos - oMStep ) + 'px';
                                }
                        }
                }
                if( window.addEventListener ) {
                        window.addEventListener('load',doDMarquee,false);
                } else if( document.addEventListener ) {
                        document.addEventListener('load',doDMarquee,false);
                } else if( window.attachEvent ) {
                        window.attachEvent('onload',doDMarquee);
                }
                //-->
        </script>
       
<!-- <script language="JavaScript" type="text/javascript">
window.resizeTo(475, 675)
</script>

</head> -->





<body background="bg.gif" leftmargin="0" topmargin="0" rightmargin="0">
<p><font size="2" face="Arial" color="white"><center>


<table width="100%" cellpadding="0" cellspacing="0" bgcolor="black">

        <tr>
                <td height="18px"></td>
        </tr>
       
       
        <tr>
                <td>   
                        <p><font size="2" face="Arial" color="white"><center>
       
                        <form action="tom2.php" method="get">


                        Enter your zip code
                        <input type="text" name="zip" size="5">
                        <input type="submit" name="submit" value="Go">
                </font></p>     

                </form>
       
                </td>
        </tr>
       
       
        <tr>
                <td height="4px">
        </tr>
       
       
        <tr>
                <td height="1px" bgcolor="#474747"></td>
       
        </tr>
       
       
</table>



       
<table width="256px" cellpadding="0" cellspacing="0">


        <tr>
                <td height="40px"><center></td>
        </tr>

       
        <tr>
                <td>   
                        <p><font size="5" face="Arial" color="white">
                        <?php echo strtoupper ($conditionText); ?>
                        </font></p>
                </td>
        </tr>
       
       
        <tr>
                <td height="10px"><center></td>
        </tr>
       
       
<!-- GET IMAGE  -->
        <tr>
                <td><img src="images/<?php echo $conditionCode;?>.gif"></td>
        </tr>
       
       
        <tr>
                <td height="10px"><center></td>
        </tr>
       

<!-- PUNISHMENT TEXT 1 -->
                <tr>
                <td height="5px" bgcolor="#000000"><center></td>
        </tr>
        <tr>
                <td height="5px" bgcolor="#000000"><center>
                <div class="dmarquee"><div><div><font size="2" face="Arial" color="#FFFFFF"><?php echo $message1;?></font></div></div></div>
                </td>
        </tr>
        <tr>
                <td height="5px" bgcolor="#000000"><center></td>
        </tr>
                </tr>
                <tr>
                <td height="10px"><center></td>
        </tr>
       

<!-- WARNING MESSAGE     -->
        <tr>
                <td height="5px" bgcolor=<?php echo $color;?>><center></td>
        </tr>
        <tr>
                <td height="5px" bgcolor=<?php echo $color;?>><center>
                <div class="dmarquee"><div><div><font size="2" face="Arial" color="#000000">WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - WARNING - - </font></div></div></div>
                </td>
        </tr>
        <tr>
                <td height="5px" bgcolor=<?php echo $color;?>><center></td>
        </tr>
                <tr>
                <td height="10px"><center></td>
        </tr>
       

<!-- PUNISHMENT TEXT 2 -->
                <tr>
                <td height="5px" bgcolor="#000000"><center></td>
        </tr>
        <tr>
                <td height="5px" bgcolor="#000000"><center>
                <div class="dmarquee"><div><div><font size="2" face="Arial" color="#FFFFFF"><?php echo $message2;?></font></div></div></div>
                </td>
        </tr>
        <tr>
                <td height="5px" bgcolor="#000000"><center></td>
        </tr>
       
       
</body>




</html>
 

Retrieved from http://linkedbyair.net/nt1/wiki/Assignments/Assignment2Tom
Page last modified on April 26, 2006, at 01:48 AM