-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontestsubmit.php
More file actions
159 lines (98 loc) · 2.74 KB
/
contestsubmit.php
File metadata and controls
159 lines (98 loc) · 2.74 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
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
151
152
153
154
155
156
157
158
159
<?php
session_start();
require_once("config.php");
require_once("connection.php");
if(!isset($_SESSION['un']))
{
header("Location:login.php");
}
if(isset($_SESSION['un']))
{
$username=$_SESSION['un'];
}
?>
<?php
$c=0;
if(isset($_GET['id']))
{
$problemid=$_GET['id'];
$c=1;
}
$sql="SELECT * FROM element WHERE pbid='$problemid' ";
$sq=mysqli_query($con,$sql);
$row=mysqli_fetch_array($sq);
//echo "<textarea style=\"display:none;\" name=\"in\"
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Submit</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/style.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script src="js/vendor/jquery-1.12.0.min.js"></script>
<script src="bootstrap-3.3.7/js/bootstrap.min.js" </script>
<script src="bootstrap-3.3.7/js/bootstrap.js" </script>
<script src="js/jquery.nivo.slider.js" type="text/javascript"></script>
</head>
<body>
<div class="main">
<?php
include("header.php");
?>
<div class="row log">
<div class="col-sm-10">
<div class=""><h3 style="text-align:center;">Submit Code</h3></div>
</div>
<div class="col-sm-1">
</div>
<div class="col-sm-1">
</div>
</div>
<div class="row cspace">
<div class="col-sm-8">
<div class="form-group">
<form action="pcompile.php" name="f2" method="POST">
<label for="language">Choose Language</label>
<select class="form-control" name="language">
<option value="c">C</option>
<option value="cpp">C++</option>
<option value="java">Java</option>
</select><br><br>
<?php
if($c==1)
{
//echo "<input type=\"hidden\" name=\"pbn\" value=\"$problem\">";
echo "<input type=\"hidden\" name=\"id\" value=\"$problemid\">";
}
else
{
echo"<label for=\"pp\">Enter Problem ID</label><br>";
//echo "<input class=\"form-control\" type=\"text\" name=\"pbn\">";
echo "<input class=\"form-control\" type=\"text\" name=\"id\">";
}
?>
<label for="ta">Write Your Code</label>
<textarea class="form-control" name="src" rows="10" cols="50"></textarea><br><br>
<input type="hidden" name='pbn' value="<?php echo $row['pbname']; ?>">
<input type="submit" class="btn btn-success" value="Submit"><br><br><br>
</form>
</div>
<div class="col-sm-4">
</div>
</div>
</div>
<br><br><br>
<?php
include("footer.php");
?>
</div>
</body>
</html>