-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuploadpic.php
More file actions
93 lines (91 loc) · 2.23 KB
/
uploadpic.php
File metadata and controls
93 lines (91 loc) · 2.23 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
<!--written by: Katherine -->
<html>
<head>
<link href="css/main.css" rel="stylesheet" type="text/css">
<title>Upload Screenshots</title>
<?php
include_once("php_includes/nav.php");
include_once("php_includes/header.php");
include("php_includes/upload_file.php");
include("php_includes/sessions.php");
include("php_includes/removeimg.php");
?>
</head>
<body>
<div id="uploadscn">
<h2>Screenshots</h2>
<?php
include("php_includes/connection.php");
$sql = "SELECT * FROM screenshots WHERE username='".$self."'";
$result = mysqli_query($c, $sql);
$i = 1;
echo "<table width=\"100%\" style=\"height: 13em;\">";
while($pic = mysqli_fetch_array($result)) {
if($i%5 == 1){
echo "<tr>";
}
$pathToPic = "user_screenshots/" . $self . "/" . $pic['data'];
$i ++;
echo "<td style=\"width:20%;\"><img src=\"" . $pathToPic . "\"
style=\"width:13em;\"><br>";
echo "<small>" . $pic['gamename'] . "<br>";
echo $pic['filename'] . "<br>";
echo $pic['description'] . "</small><br>";
echo '<form method="post" action="uploadpic.php" >';
echo '<input type="hidden" value="'. $pic['data'] .'" name="pfile" />';
echo '<input type="submit" name="removeimg" value="remove" />';
echo '</form></td>';
}
if($i%5 == 0){
echo "</tr>";
}
echo "</table>";
mysqli_close($c);
?>
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post"
enctype="multipart/form-data">
<?php echo $Error ?>
<table>
<tr>
<td>
Add Screenshot:
</td>
<td>
<input type="file" name="uploaded_file" id="file">
</td>
</tr>
<tr>
<td>
Game Name:
</td>
<td>
<input type="text" name="gamename">
</td>
</tr>
<tr>
<td>
Name:
</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>
Description:
</td>
<td>
<input type="text" name="description">
</td>
</tr>
<tr>
<td>
<input type="submit" name="UPsubmit" value="Add">
</td>
</tr>
</table>
</form>
</div>
<?php include_once('php_includes/footer.php'); ?>
</body>
</html>