-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathproblem_pdf.php
More file actions
36 lines (31 loc) · 1.11 KB
/
problem_pdf.php
File metadata and controls
36 lines (31 loc) · 1.11 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
<?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()) ;
if (!isset($_SESSION['account'])){
header ("Location:index.php") ;
} else {
$query_past = "SELECT past_id FROM past_hw";
$past_id = mysql_query($query_past);
?>
<div class="hero-unit upload_section">
<p>Past Problems</p>
<table class="table table-hover">
<!--<input type='text' name='past_id' class='past-id' value='<?php echo $_POST['pastID']?>'>-->
<p><?php echo $_POST['pastID']?></p>
<embed src='./past/<?php echo $_POST['pastID']?>/<?php echo $_POST['pastID']?>.pdf' height="600" width="820">
<button type='button' class='btn btn-link btn-large submit-past-btn' name='<?php echo $_POST['pastID']?>'>Submit This Problem!</button>
</table>
</div>
<script src="js/past.js"></script>
<?php
}
?>