-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoloresPOST2(David).php
84 lines (72 loc) · 2.84 KB
/
coloresPOST2(David).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
<?php
if(empty($_POST['ans'])){
if(array_key_exists('cookieImagen', $_COOKIE)){
$imagen = $_COOKIE['cookieImagen'];
}else {
$imagen = "https://miro.medium.com/max/4800/1*r2fR_OBcBCSUtfLLaTX3JA.png";
}
}else{
$imagen = htmlspecialchars( $_POST['ans']);//lo de htmlspecialchars es por si hay algun caracter raro en la url no de fallo
setcookie('cookieImagen', $imagen,time()+(86400 * 30));//86400 --> segundos en 1dia
}
?>
<!DOCTYPE HTML>
<!--
Identity by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<title>Identity by HTML5 UP</title>
<meta charset="utf-8" />
<meta name="Referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="https://html5up.net/uploads/demos/identity/assets/css/main.css" />
<noscript><link rel="stylesheet" href="https://html5up.net/uploads/demos/identity/assets/css/noscript.css" /></noscript>
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<section id="main">
<header>
<span class="avatar"><img src=<?php echo $imagen ?> alt="" width="256px"/></span>
<h2>Elección de colores</h2>
<form name="calculator" action="" method="post">
<!-- Escribe el resultado como valor de la propiedad value -->
<input type="textfield" name="ans" value="" style="background-color:rgb(255, 255, 255)">
<br>
<label for="rojo">Rojo:</label>
<input type="range" name="rojo" value="" min="0" max="255">
<label for="verde">Verde:</label>
<input type="range" name="verde" value="" min="0" max="255">
<label for="azul">Azul:</label>
<input type="range" name="azul" value="" min="0" max="255">
<br>
<input type="submit" value="Mostrar color">
<input type="reset" value="Cancelar">
</form>
</header>
<footer>
<ul class="icons">
</ul>
</footer>
</section>
<!-- Footer -->
<footer id="footer">
<ul class="copyright">
<li>© Jane Doe</li><li>Design: <a href="http://html5up.net">HTML5 UP</a></li>
</ul>
</footer>
</div>
<!-- Scripts -->
<script>
if ('addEventListener' in window) {
window.addEventListener('load', function() { document.body.className = document.body.className.replace(/\bis-preload\b/, ''); });
document.body.className += (navigator.userAgent.match(/(MSIE|rv:11\.0)/) ? ' is-ie' : '');
}
</script>
</body>
</html>
<!-- Documento HTML-->