Peter,
You should put
<?php echo get_UVrange('^vxv017^'); ?>
on your page where you want the UV 'words' to appear.
Then at the end of the page, put
<?php
//=========================================================================
// decode UV to word+color for display
function get_UVrange ( $uv ) {
// figure out a text value and color for UV exposure text
// 0 to 2 Low
// 3 to 5 Moderate
// 6 to 7 High
// 8 to 10 Very High
// 11+ Extreme
switch (TRUE) {
case ($uv == 0):
$uv = 'None';
break;
case (($uv > 0) and ($uv < 3)):
$uv = '<span style="border: solid 1px; background-color: #A4CE6a;"> Low </span>';
break;
case (($uv >= 3) and ($uv < 6)):
$uv = '<span style="border: solid 1px;background-color: #FBEE09;"> Medium </span>';
break;
case (($uv >=6 ) and ($uv < 8)):
$uv = '<span style="border: solid 1px; background-color: #FD9125;"> High </span>';
break;
case (($uv >=8 ) and ($uv < 11)):
$uv = '<span style="border: solid 1px; color: #FFFFFF; background-color: #F63F37;"> Very High </span>';
break;
case (($uv > 11) ):
$uv = '<span style="border: solid 1px; color: #FFFF00; background-color: #807780;"> Extreme </span>';
break;
} // end switch
return $uv;
} // end get_UVrange
?>
PHP is kinda funny .. it needs a '<?php' at the start of the PHP code, and a '?>' at the end of the code to mark where the PHP interpreter is to read/parse/execute the PHP code. Stuff outside the <?php .... ?> is treated a plain HTML and not parsed nor executed by PHP. Also.. in PHP, cASe is important in the names of variables and functions so
get_UVrange is not the same as get_uvrange nor GeT_UVRange .. make sure the function name (in this case get_UVrange) matches in the calling sequence '<?php echo get_UVrange('^vxv017^'); ?>' and in the function definition 'function get_UVrange'
I'm assuming you're uploading index2.htx through VWS as index2.php in this example .. otherwise the ^vxv017^ in the PHP script won't be replaced by VWS with the current UV index, and the script won't work correctly.
Hope this helps...
Best regards,
Ken