<?php
	session_start();
	error_reporting(0);
	
	$candidate = $_SESSION['text-highlight_COLOR'];
	
	if(isset($candidate)) {
		$color = $candidate;
	}
	else {
		$color = "green";
	}
?>

<!DOCTYPE HTML>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Highlight Change Color test</title>
	</head>
	<body>
		<style>
			::selection {
				background-color: <?php echo $color; ?>;
				color: #fff;
			}
			.m-font {
				font-family: Arial;
				background: #e8effa;
				padding: 13px;
				display: inline-block;
			}
		</style>

		<div>
			<form action="color-change.php" method="POST">
				<label for="ccode">Select color: </label>
				<input id="ccode" type="color" name="ccode" placeholder="#fffff">
					
				<input type="submit" value="Change Color !">
			</form>
			<form action="color-change.php" method="POST">
				<label for="ccode"><b>Or</b><br>Enter Color Code: </label>
				<input id="ccode" type="text" name="ccode" placeholder="#fffff">
					
				<input type="submit" value="Change Color !">
			</form>
			
			<p class="m-font">
				Try Hightlighting this text !! :)<br>
				Write "#" it's not actually necesarry!<br>
				Input: <?php echo $color; ?>
				
				<!--
				Fix OK: <?php echo $_SESSION['text-highlight_FIX']; ?>
				-->
			</p>
		</div>
	</body>
</html>