hip1/11.8.php

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <?php setcookie('colour', $_COOKIE['colour'] = $_POST['colour']); ?> <style> body{ background-color: <?php echo $_COOKIE['colour']?> } </style> <form method="post"> <div> <label for="colour">Colour: </label> <input type="color" name="colour" value=<?php echo $_COOKIE['colour']?> required> </div> <div> <input type="submit" value="submit"> </div> </form> </body> </html>

Resultaat

Made by Thijs Aarnoudse