Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    logic problem - small interactive module

    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

  • #2
    New Coder dragon's Avatar
    Join Date
    May 2003
    Location
    Florida
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    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.

    PHP Code:
    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.

    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.

    PHP Code:
    if($_REQUEST['highlight']=='garnet'
       echo 
    ' class="highlight"'
    Last edited by dragon; 02-19-2006 at 01:41 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •