Browse Source

better check for requested page

tkas 1 year ago
parent
commit
3ad2bb3d25
1 changed files with 3 additions and 4 deletions
  1. 3 4
      tables/index.php

+ 3 - 4
tables/index.php

@@ -9,10 +9,9 @@ include "php/phplot/phplot.php";
 //possible values for page views
 $pages = array('table');
 
-if(!(isset($_GET['pg']))){
-    $page = "stats";
-} else {
-    if(in_array($_GET['pg'],$pages)) $page = $_GET['pg'];
+$page = "stats";
+if(isset($_GET['pg']) && in_array($_GET['pg'],$pages)) { 
+  $page = $_GET['pg'];
 }
 
 ?>