-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupload_past.php
More file actions
47 lines (45 loc) · 1.63 KB
/
upload_past.php
File metadata and controls
47 lines (45 loc) · 1.63 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
<?php
session_start() ;
$db_host = 'localhost' ;
$db_database = 'pd course' ;
$db_username = 'root' ;
$connection = mysql_connect($db_host, $db_username, 'pdogsserver');
if (!$connection)
die ("connection failed".mysql_error()) ;
mysql_query("SET NAMES 'utf8'");
$selection = mysql_select_db($db_database) ;
if (!$selection)
die ("selection failed".mysql_error()) ;
$acc = mysql_real_escape_string($_SESSION['account']);
$ID = isset($_POST['pastID']);
if (!isset($_SESSION['account'])){
header ("Location:index.php") ;
} else {
?>
<form method="POST" action="result_past.php" id="fileUploadForm" enctype="multipart/form-data">
<div class="hero-unit upload_section">
<h4> Submit Problem ID: </h4>
<input type='text' name='past_id' class='past_id' value='<?php if ($ID) {echo $_POST['pastID'];}?>'>
<h4 class="hw"> File format: .c or .cpp </h4>
<h4 class="hw"> File size: max 3MBs</p>
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input span3">
<i class="icon-file fileupload-exists"></i>
<span class="fileupload-preview"></span>
</div>
<span class="btn btn-file">
<span class="fileupload-new">Select file</span>
<span class="fileupload-exists">Change File</span>
<input type="file" class="upload" name="upload"/>
</span>
<a class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
<a class="btn fileupload-exists upload-button" >Upload</a>
</div>
</div>
</div>
</form>
<script src="js/upload.js"></script>
<?php
}
?>