-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathphp.php
executable file
·91 lines (84 loc) · 3.38 KB
/
php.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
//--- begin timer ---//
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
//------------------//
require_once ("config.php");
require_once (INCLUDE_DIR . "common.php");
require_once (INCLUDE_DIR . "User.php");
require_once ("classes/ITS_navigation.php");
//$timer = new ITS_timer();
session_start();
// return to login page if not logged in
abort_if_unauthenticated();
$id = $_SESSION['user']->id();
$status = $_SESSION['user']->status();
$info = & $_SESSION['user']->info();
//------------------------------------------//
// NAVIGATION
$current = basename(__FILE__,'.php');
$ITS_nav = new ITS_navigation($status);
$nav = $ITS_nav->render($current,'');
//---------------------------------------------//
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>PHP eval</title>
<!---->
<link rel="stylesheet" href="css/ITS.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_navigation.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_users.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/login.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/admin.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_jquery.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_computeScores.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_search.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_BOOK.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ITS_php.css" type="text/css" media="screen">
<script type="text/javascript">
function getfocus() {document.getElementById("ITS_search_box").focus()}
</script>
</head>
<body onload="getfocus()">
<div id="framecontent">
<!---************* NAVIGATION ******************--->
<?php echo $nav;?>
<!---******************************************--->
<div class="innertube"></div>
<!---******************************************--->
</div>
<center>
<form id="ITS_search" action="php.php" method="post">
<input id="ITS_search_box" type="text" name="keyword">
</form>
<?php
$intro = '<p>Enter a PHP math expression.<ul class="ex"><li>sqrt(pow(3,2) + pow(4,2))</li><li>fmod(7.3,1.3)</li></ul></p>';
if (isset($_POST['keyword'])) {
if ($_POST['keyword']) {
$keyword = $_POST['keyword'];
eval("\$php=" . $keyword . ";" );
if (is_null($php)) {
echo '<p>Unable to evaluate the expression:<br><p style="color:red">'.$keyword.'</p></p>'.$intro;
}
else {
$out = '<table class="key">'.
'<tr>'.
'<td style="color:#999">'.$keyword.'</td><td> = </td><td class="out">'.$php.'</td>'.
'</tr>';
echo '<center>'.$out.'</center>';
}
} else {
echo $intro;
}
} else {
echo $intro;
}
//-----------------------------------------------------------//
?>
</center>
</body>
</html>