AshleyQuick
03-31-2004, 09:20 PM
This script works nicely. I just wish there was a way in which you could hide the "...?color=hexcode" that you see in the url. I just don't want the user to think about changing the hex values in the url hoping it will change the colors. Is there an easy way to accomplish this?
*Note - I used the full url in the img src so you can view the images.
<?php
$color = !isset($_GET['color']) ? '82CA9C' : $_GET['color'];
?>
<head>
<title></title>
<link rel="stylesheet" href="css/global.css" type="text/css" />
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0">
<table bgcolor="<?php print $color;?>" class="main" height="100%">
<tr>
<td height="99%"><br> </td>
</tr>
<tr valign="bottom">
<td bgcolor="#ffffff" height="16"><br /><br />
Choose color scheme:<br /><br />
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=FBAF5D"><img alt="orange" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/FBAF5D.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=448CCB"><img alt="blue" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/448CCB.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=A186BE"><img alt="purple" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/A186BE.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=AB5671"><img alt="magenta" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/AB5671.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=A67C52"><img alt="brown" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/A67C52.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=82CA9C"><img alt="green" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/82CA9C.gif" /></a><br /><img alt="" border="0" width="1" height="25" src="art/spacer.gif" /></td>
</tr>
</table>
</body>
</html>
*Note - I used the full url in the img src so you can view the images.
<?php
$color = !isset($_GET['color']) ? '82CA9C' : $_GET['color'];
?>
<head>
<title></title>
<link rel="stylesheet" href="css/global.css" type="text/css" />
</head>
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0">
<table bgcolor="<?php print $color;?>" class="main" height="100%">
<tr>
<td height="99%"><br> </td>
</tr>
<tr valign="bottom">
<td bgcolor="#ffffff" height="16"><br /><br />
Choose color scheme:<br /><br />
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=FBAF5D"><img alt="orange" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/FBAF5D.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=448CCB"><img alt="blue" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/448CCB.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=A186BE"><img alt="purple" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/A186BE.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=AB5671"><img alt="magenta" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/AB5671.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=A67C52"><img alt="brown" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/A67C52.gif" /></a>
<a href="<?php echo $_SERVER[PHP_SELF];?>?color=82CA9C"><img alt="green" border="0" width="24" height="16" src="http://mywebpages.comcast.net/maxpixel/dev/phpcolorswitcher/art/82CA9C.gif" /></a><br /><img alt="" border="0" width="1" height="25" src="art/spacer.gif" /></td>
</tr>
</table>
</body>
</html>