-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex1.php
More file actions
92 lines (70 loc) · 2.13 KB
/
index1.php
File metadata and controls
92 lines (70 loc) · 2.13 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<title>RDDS Compiler</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<meta name="viewport" content="width=device-width, user-scalable=no">
</head>
<body>
<div id="topBar">
<span id="title"><em>RDDS</em> Compiler</span>
</div>
<div id="console">
<div id="settings">
</div>
<div id="content">
<div id="left">
<form method="post" action="index1.php">
<textarea maxlength="5000000000000" rows="19" cols="60" id="jscontent" name="textarea">
<?php
if (isset($_POST['textarea']))
{
$textarea=$_POST['textarea'];
$myfile = fopen("test.src", "w") or die("Unable to open file!");
fwrite($myfile, $textarea. PHP_EOL);
fclose($myfile);
echo $textarea;
}
?>
</textarea>
<?php
echo "-----INPUT-----";?>
<textarea maxlength="5000000000000" rows="2" cols="60" id="jscontent" name="inp" placeholder= "input" style = "border: solid;">
<?php
if (isset($_POST['inp']))
{
$textarea=$_POST['inp'];
$myFile = "input.txt";
file_put_contents($myFile,$textarea);
}
?>
</textarea>
<button class="material-button red" name = "compile"><span>Compile</span></button>
<!--<button class="material-button red" onclick="reloadPage()"><span>Reload Page</span></button>-->
</form>
<form>
<button class="material-button blue" onclick=dj()><span>clear editor</span></button>
<script>
function dj()
{
window.location.href="http://127.0.0.1/index1.php";
}
</script>
</form>
<a href="https://github.com/Raghav714/" target="_blank"><button class="material-button orange"><span>View Github</span></button></a>
<a href="https://sites.google.com/view/gauravkumarraghav" target="_blank"><button class="material-button orange"><span>Main Website</span></button></a>
</div>
<div id="right">
<?php
echo "OUTPUT </br> ";
if (isset($_POST['textarea']))
{
echo shell_exec("python3 <path>compiler.py -o OUT test.src");
echo shell_exec("./a.out < input.txt");
}
?>
</div>
</div>
</div>
</body>
</html>