-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetbgimg.php
129 lines (65 loc) · 2.28 KB
/
setbgimg.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
require_once('function.php');
dbconnect();
session_start();
if (!is_user()) {
redirect('index.php');
}
?>
<?php
$user = $_SESSION['username'];
$usid = $pdo->query("SELECT id FROM users WHERE username='".$user."'");
$usid = $usid->fetch(PDO::FETCH_ASSOC);
$uid = $usid['id'];
include ('header.php');
?>
<div class="pageheader">
<h2><i class="fa fa-cog"></i> Background Image </h2>
</div>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<!--div class="panel-heading">
<div class="panel-btns">
<a href="#" class="panel-close">×</a>
<a href="#" class="minimize">−</a>
</div>
</div-->
<div style="display: block;" class="panel-body panel-body-nopadding">
<?php
// IMAGE UPLOAD //////////////////////////////////////////////////////////
$folder = "../img/";
$extention = strrchr($_FILES['bgimg']['name'], ".");
$new_name = "bg";
$bgimg = $new_name.'.jpg';
$uploaddir = $folder . $bgimg;
move_uploaded_file($_FILES['bgimg']['tmp_name'], $uploaddir);
//////////////////////////////////////////////////////////////////////////
?>
<form name="" id="" action="" method="post" enctype="multipart/form-data" >
<br/>
<div class="form-group">
<label class="col-sm-3 control-label">Background Image</label>
<div class="col-sm-6"><input name="bgimg" type="file" id="bgimg" /></div>
</div>
</div><!-- panel-body -->
<div style="display: block;" class="panel-footer">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
Demo Version!! You Cant Change!
</div>
</div>
</form>
</div><!-- panel-footer -->
Current Image : <br/><img src="../img/bg.jpg" width="600px;" height="400px" alt="IMG">
<br/><br/><br/><br/>
</div><!-- panel -->
</div>
</div><!-- row -->
</div><!-- contentpanel -->
<?php
include ('footer.php');
?>
</body>
</html>