-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute_php.php
More file actions
74 lines (70 loc) · 2.42 KB
/
execute_php.php
File metadata and controls
74 lines (70 loc) · 2.42 KB
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
<?php
$code= $_POST['tcccode'];
$file= $_POST['file'];
$input=$_POST['input'];
?>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="css/styles-execute.css" rel="stylesheet" type="text/css" />
<link href="menu_bar.css" rel="stylesheet" type="text/css" />
<link href="css/fade.css" rel="stylesheet" type="text/css" />
<link href="lib/codemirror.css" rel="stylesheet" type="text/css" />
<script src="lib/codemirror.js"></script>
<script src="mode/clike/clike.js"></script>
<link rel="stylesheet" href="docs/docs.css" />
<link rel="stylesheet" href="lib/theme/night.css" />
<script src="mode/javascript/javascript.js"></script>
<style>.CodeMirror {border:2px solid black;}</style>
<title>The-Code Plus</title>
</head>
<body>
<div style="position:absolute; width:100%; z-index:1;" align="center">
<div style="width:760px; z-index:2; align="left">
<div style="position:relative;margin:262px 50px auto -95px;"><?php include('aa_03.php');?></div>
<div id="page-wrap">
<?php
$my_input = "GUEST_PHP/input".".txt";//i have reassigned the variable...to work concatenation MAGIC :-D.
$lever = fopen($my_input, 'w') or die('Cannot open file: '.$my_input);
fwrite($lever, $input);
$my_file = "GUEST_PHP/$file".".php";//i have reassigned the variable...to work concatenation MAGIC :-D.
$fileo="GUEST_PHP/$file";
$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);
fwrite($handle, $code);
$inputc="GUEST_PHP/input.txt";
$outputc="GUEST_PHP/output.txt";
$logc="GUEST_PHP/log.txt";
//$run="PHP GUEST_PHP/'$file'>>$outputc";
$runin="php $my_file>$outputc";
//$cmd="javac $my_file 2> $logc";
//system($cmd,$retc);
//if(!$retc){
system($runin);
?>
<span>OUTPUT FOR THE PROGRAM</span> <br/><br/>
<div style="background-color: #FFFFFF;overflow:scroll;">
<object type="text/plain" data="<?php echo $outputc; ?>" width="800px">
</object>
</div>
<br/><br/>
<span>ERROR/WARNING FOR THE PROGRAM</span> <br/><br/>
<div style="background-color: #FFFFFF;overflow:scroll;">
<object type="text/plain" data="<?php echo $logc; ?>" width="800px">
</object>
</div>
<br />
</div>
</div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-csrc"
});
function selectTheme(node) {
var theme = node.options[node.selectedIndex].innerHTML;
editor.setOption("theme", theme);
}
</script>
</body>
</html>