im trying to make a page that change color background by clicking on a link. however, it doesn't work. why?
can any show me a more better code to do it? thanks.
PHP Code:
<?php
if(!isset($_POST[color])) $_POST[color] = 'green';
?>
<html>
<head>
<title>Head</title>
</head>
<body bgcolor=<?php print "$_POST[color]";?>>
Welcome!
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=red">red</a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=blue">blue</a>
</body>
</html>
Comment