...

View Full Version : logic problem - small interactive module



shooka
02-19-2006, 01:12 PM
hey everyone, ive got 12 images (jewellery stones) with description. each stone and description in a different <div>.

each stone represents a month of the year.

im trying to create a interactive module where the user could type his/ her month of birth and the related stone <div> will be highlited (simple indication like a border around the <div>) the all thing is on the same page, and once the user submit his / her DOB the page will just refresh and position itself on the related stone.

anyone got any ideas how to do it?

you can view the page ive got so far at:

http://www.bellissimab.com/new/stones.php

please let me know if you need me to elaborate on anything.

Tnx, Shooka
Edit/Delete Message

dragon
02-19-2006, 01:35 PM
If you add an anchor in front of each image, you should be able to do that fairly simply by using a switch based on the month that the user submits.



switch($_REQUEST['birthmonth'])
{
case('January'):
header('Location: '.$_SERVER['PHP_SELF'].'?highlight=garnet#Garnet');
break;
case('February'):
header('Location: '.$_SERVER['PHP_SELF'].'highlight=amethyst#Amethyst');
break;
case('March'):
header('Location: '.$_SERVER['PHP_SELF'].'highlight=aquamarine#Aquamarine');
break;
etc...


By the way, you really should take a look at your site in Firefox. :eek:

Update: Since you also want to highlight the selected stone, you'll probably want to send a variable along with that to give the highlight.
Then use an if statement at the point of the image to style your div surrounding the selected stone.



if($_REQUEST['highlight']=='garnet')
echo ' class="highlight"';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum