Cleaning PHP (eew)

This commit is contained in:
Thomas FORGIONE
2015-04-09 10:00:15 +02:00
parent 5c9390da90
commit 0bbd0fb44a
3 changed files with 41 additions and 26 deletions

View File

@@ -21,31 +21,7 @@
<script src="/js/CameraContainer.js"></script>
<script src="/js/Tools.js"></script>
<script src="/js/ProgressiveSphere.js"></script>
<?php
// Set global variables
$default = 5;
$res = null;
try
{
if (isset($_GET['res']))
{
$res = intval($_GET['res']);
if ($res < 1 || $res > 25)
{
throw new Exception('Variable res not set');
}
}
else
{
throw new Exception('Variable res not set');
}
}
catch (Exception $e)
{
$res = $default;
}
echo "<script>var global_array = {res: " . $res . "};</script>\n";
?>
<script src="js/Params.js.php?<?php echo htmlentities($_SERVER['QUERY_STRING']); ?>"></script>
<script src="js/main.js"></script>
</body>
</html>