-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdoc_upload.php
More file actions
60 lines (52 loc) · 1.63 KB
/
doc_upload.php
File metadata and controls
60 lines (52 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
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php include("header.php"); ?>
<div class="container">
<h1>Link a document</h1>
<p>We do not host documents locally. Please input the URL of the document you wish to display.</p>
<form method="POST" action="insert_document.php">
<label for="courseSelect">Select a course:</label>
<select name="courseSelect">
<?php
if ($db_conn=OCILogon("ora_p1t7", "a36959104", "ug")){
$cmdstr = "select * from course_is_in";
$parsed = OCIParse($db_conn, $cmdstr);
if (!$parsed){
$e = OCIError($db_conn);
echo htmlentities($e['message']);
exit;
}
$r=OCIExecute($parsed, OCI_DEFAULT);
if (!$r){
$e = oci_error($parsed);
echo htmlentities($e['message']);
exit;
}
$i = 0;
while($row = OCI_Fetch_Array($parsed, OCI_NUM)) {
echo "<option value=" . $i . ">" . $row[3] . " " . $row[0] . " " . $row[1] . "</option>";
$_SESSION['course' . (string)$i] = $row;
$i++;
}
OCILogoff($db_conn);
}
else {
$e = OCIError();
echo htmlentities($e['message']);
}
?>
</select>
<br />
<label for="docURL">Input the document URL:</label>
<input type="text" name="docURL"></input>
<label for="docname">Input the document Name:</label>
<input type="text" name="docname"></input>
<br />
<input class="btn-large" type="submit" value="submit" name="insertsubmit"/>
</form>
<?php
if(isset($_SESSION['insert_document_result'])) {
echo($_SESSION['insert_document_result'] );
unset($_SESSION['insert_document_result'] );
}
?>
</div> <!-- /container -->
<?php include("footer.php"); ?>