-
Notifications
You must be signed in to change notification settings - Fork 0
/
uploadprofile.php
38 lines (36 loc) · 1.17 KB
/
uploadprofile.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<link href="fotoapp.css" rel="stylesheet">
<?php
require("nav.php");
require("db.php");
?>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://app.simplefileupload.com/buckets/807627ca14520b5bbb91e89b80283b37.js"></script>
<title>Upload file</title>
</head>
<body>
<form action = "" method = "post" enctype = "multipart/form-data">
<input type="hidden" name="avatar_url" id="avatar_url" class="simple-file-upload" require>
<br>
<input type="submit" name="submit" id="submit">
</form>
<?php
session_start();
if(isset($_POST['avatar_url']))
{
echo "<br>";
echo "Your post:<br>";
echo "<br>";
echo "<img src='".$_POST['avatar_url']."'>";
$user = $_SESSION['username'];
$avatar_url = $_POST['avatar_url'];
$sql="UPDATE `user` SET `Profile`='".$avatar_url."' WHERE `Username`='".$user."'";
$conn->exec($sql);
}
?>
</body>
</html>