-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeStyle.php
More file actions
44 lines (37 loc) · 1.14 KB
/
Copy pathchangeStyle.php
File metadata and controls
44 lines (37 loc) · 1.14 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
<?php
session_start();
if (!isset($_SESSION['user']))
{
header("refresh:0,index.php");
die();
}
if (isset($_FILES['fundo']))
{
$name = explode(".", $_FILES["fundo"]["name"]);
$size = count($name)-1;
if (strtolower($name[$size]) == "jpg")
{
move_uploaded_file($_FILES['fundo']['tmp_name'], "images/".$_SESSION['user'].".jpg");
echo $_FILES['fundo']['tmp_name']. "<br>images/".$_SESSION['user'].".jpg";
}
}
if (isset($_POST["transparencia"]))
{
$trasparencia = 0.7;
}
else{
$trasparencia = 1;
}
$css = "
body{background: url('../images/" . $_SESSION['user']. ".jpg');
background-size: cover;
background-repeat: no-repeat;
}
.card{
background-color: " . $_POST["cor_cartao"] . "
; opacity: ". $trasparencia .";}
";
file_put_contents("style/". $_SESSION["user"] . ".css", $css);
header("refresh:0,dashboard.php");
die();
?>