I have these variables:
$White = 'FFFFFF';
$Black = '000000';
$Grey = 'A0A0A4';
$Green = '00FF00';
$Red = 'FF0000';
$Cyan = '00FFFF';
$Yellow = 'FFFF00';
$Blue = '0000FF';
$Magenta = 'FF00FF';
$color = &$Yellow;
When page loads: $color = &$Yellow;
I have a table that looks like a bar of colors.
See: http://www.3dmypage.com/3djava/3dview_r ... d=3dmp0001 (this page may take a while to load).
When a user clicks on one of the colors (images) the variable needs to change. For example; user clicks on the color green and the variable changes: $color = $Green;
The page will probably have to refresh also.
How can I change the variable and refresh the page when a user clicks on a color (image)?
Click on image to change variable
Moderator: General Moderators
- Tom McConnell
- Forum Newbie
- Posts: 2
- Joined: Fri Sep 12, 2008 9:21 am
- Location: 3DMypage
Re: Click on image to change variable
you get the selection by $_GET[mycolor'];
then in your code
then in your code
Code: Select all
$color = (isset($_GET['color'])) ? $_GET['color'] : $Yellow;
...
<a href="thispage.php?color=<?=$White?>">White</a>
<a href="thispage.php?color=<?=$Black?>"> Black </a>
- Tom McConnell
- Forum Newbie
- Posts: 2
- Joined: Fri Sep 12, 2008 9:21 am
- Location: 3DMypage
Re: Click on image to change variable
Thank you very much!
Works great.
Check it out if you like:
http://www.3dmypage.com/3d/114-7/Brass-Vase.php and click "View 3D Model"
P.S. I had to change: <a href="thispage.php?color=<?=$White?>">White</a> to <a href="thispage.php?color=<?=$White?></a>
http://www.3dmypage.com/3d/114-7/Brass-Vase.php and click "View 3D Model"
P.S. I had to change: <a href="thispage.php?color=<?=$White?>">White</a> to <a href="thispage.php?color=<?=$White?></a>