-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
150 lines (112 loc) · 3.83 KB
/
index.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!--
Author : Jenson M John (http://jenson.in/iblog/about-2/)
Please note : The folder should have write permission enabled. This is for creation of new file.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="PHP Fiddle Space" />
<meta name="keywords" content="PHP fiddle, fiddle php, PHP Code fiddle" />
<meta name="author" content="Jenson M John" />
<link rel="stylesheet" href="css/codemirror.css">
<script src="js/jquery-2.1.0.min.js"></script>
<script src="js/codemirror.js"></script>
<script src="js/matchbrackets.js"></script>
<script src="js/htmlmixed.js"></script>
<script src="js/clike.js"></script>
<script src="js/xml.js"></script>
<script src="js/javascript.js"></script>
<script src="js/css.js"></script>
<script src="js/php.js"></script>
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<link rel="stylesheet" href="css/docs.css">
<title>PHP </title>
<script>
$(document).ready(function(){
$("#submitForm").on("click",function(){
var code = editor.getValue();
$.post('process.php', {codesrc: code}, function(data){
$.get( "scriptarea.php", function(data) {
$("#output").show();
$('#compiledResult').html(data);
$("#compiledResult").show();
});
}).fail(function() {
alert("Oh man! Smething kinda pblm!");
});
});
});
</script>
<style>
#srcDiv{
border:1px solid; width:703px; float:left; margin-right:10px;
}
.btn {
background: #0057CC;
background-image: -webkit-linear-gradient(top, #0057CC, #0057CC);
background-image: -moz-linear-gradient(top, #0057CC, #0057CC);
background-image: -ms-linear-gradient(top, #0057CC, #0057CC);
background-image: -o-linear-gradient(top, #0057CC, #0057CC);
background-image: linear-gradient(to bottom, #0057CC, #0057CC);
-webkit-border-radius: 10;
-moz-border-radius: 10;
border-radius: 10px;
text-shadow: 6px 1px 3px #666666;
font-family: Arial;
color: #f2f2f5;
font-size: 18px;
padding: 5px 10px 5px 10px;
text-decoration: none;
}
.btn:hover {
background: #0057CC;
text-decoration: none;
}
</style>
</head>
<body>
<div id="wrap">
<div id="contentwide">
<h2 align="center" style="color:#0057CC; border: 1px solid rgb(200, 200, 200)">PHP/HTML/JavaScript Code Playground</h2>
<div id="mainDiv">
<div id="srcDiv">
<form name="phpfiddle" id="phpfiddle">
<table width="100%" border="0" align="center">
<tr>
<td width="100%" valign="top"><h4 style="color:#0057CC; padding:3px;">Enter Code Below.</h4>
<textarea name="code" id="code" cols="55" rows="20" placeholder=""><?php if(isset($code)) echo $code; ?></textarea></td>
</tr>
<tr>
<td align="center" valign="top"><input type="button" class="btn" id="submitForm" name="submitForm" value="Execute My Code!"/></td>
</tr>
</table>
</form>
</div>
<div style="padding:5px; height:100%; width:100%">
<p id="egCode">
Eg. <br/><?php
highlight_string('<?php echo "This Is Awesome..:)"; ?>');
?>
</p>
<h3 id="output" align="center" style="display:none;">Output</h3>
<p id="compiledResult">
</p>
</div>
</div>
</div>
</div>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "application/x-httpd-php",
indentUnit: 4,
indentWithTabs: true,
enterMode: "keep",
tabMode: "shift"
});
</script>
<div style="clear:both; border: 1px solid rgb(200, 200, 200)" align="center"><a style="color:blue;" href="http://jenson.in/iblog/about-2/" target="_blank">Jenson.in</a></div>
</body>
</html>