www-thermferm/utilities.php

changeset 137
e4518fd9b626
parent 134
f05601490415
child 155
0d86f3c0a07b
--- 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>';
+}
+

mercurial