<!Doctype html>
<html>
<head>
</head>
<script type="text/javascript">
function fondocolor(color) {document.bgColor = <?php echo $fondo?>;}
</script>
<body>
<form action="#" method="GET">
<input type="color" name="color">
<input type="submit" value="confirmar">conf</input>
</form>
<?php
$fondo = $_GET['color'];
?>
</body>
</html>
No entiendo que parte esta mal. Aunque tampoco se mucho PHP.
;D Un saludo y gracias por leer!!
1. Estas usando una función fondocolor(){}, que no invocas.
2. Estás dando un valor a la variable $fondo, al finalizar la carga de la página, y la función donde se usa el valor, esta al principio, así qué si miras el código fuente la document.bgColor no debe de contener nada....
<!Doctype html>
<html>
<head>
</head>
<script type="text/javascript">
function fondocolor(color) {document.bgColor = color; document.getElementById('letras').innerHTML = color;}
</script>
<body>
<form action="#" method="GET">
<input type="color" name="color" id="color">
<input type="button" onclick="fondocolor(document.getElementById('color').value);" value="confirmar">conf</input>
</form>
<span id="letras">
Ninguno
</span>
</body>
</html>
te ahorrarias muchisimo asi :)
Gracias por vuestra ayuda!! ;D