--- a/www-thermferm/utilities.php Sat Jul 26 13:18:00 2014 +0200 +++ b/www-thermferm/utilities.php Sat Jul 26 17:30:47 2014 +0200 @@ -46,13 +46,13 @@ -function build_header() +function build_header($heading) { $outstr = '<!DOCTYPE html>'.PHP_EOL; $outstr .= '<html>'.PHP_EOL; $outstr .= ' <head>'.PHP_EOL; $outstr .= ' <meta http-equiv="content-type" content="text/html; charset=utf-8" />'.PHP_EOL; - $outstr .= ' <title>ThermFerm monitor</title>'.PHP_EOL; + $outstr .= ' <title>'.$heading.'</title>'.PHP_EOL; $outstr .= ' <link type="text/css" href="css/style.css" rel="stylesheet" media="all" />'.PHP_EOL; $outstr .= ' </head>'.PHP_EOL; $outstr .= ' <body class="default">'.PHP_EOL; @@ -80,3 +80,17 @@ } + +/* + * Goto URL. Works also after headers have been sent. + */ +function load($url) { + echo' + <script> + if (top.location != self.location) { + top.location = "'.$url.'" + } + {location.href="'.$url.'";} + </script>'; +} +