Results 1 to 2 of 2

Thread: PHP functions on Image Maps

  1. #1
    Join Date
    Sep 2010
    Posts
    38

    PHP functions on Image Maps

    OK. I am a complete newbie with PHP, but I know databases, Visual Basic and SQL.

    What I am trying to accomplish is populate a drop down menu from a table on my server based on a image map hot spot selection.

    Currently my image maps are linked to pages by the href="Page.html" parameter.

    Code:
     <area shape="poly" coords="181,186,158,181,147,167,171,172,175" href="M_BC.html" target="_self" alt="British Columbia">
    How can I attach a function to a hot spot?

    I would think, every hot spot will have its own variable, which will help me filter my table and load the results in the drop down list.

    If you have anything similar coding on your pages, an example will be great!

  2. #2
    Join Date
    Apr 2009
    Location
    The toon
    Posts
    1,225
    If your image maps are directing to the same page but you want to identify whats clicked you could use a query string appended to the href value.

    notice I have changed the page to a PHP extension. (M_BC.php) And notice the ?id=map1 after the page is defined.

    HTML Code:
     <area shape="poly" coords="181,186,158,181,147,167,171,172,175" href="M_BC.php?id=map1" target="_self" alt="British Columbia">
    What you can do here is on the M_BC.php page add...

    PHP Code:
    $id $_GET['id']; 
    This catches the value from the id key value which in the example above would be map1

    just use a condition to test the $id variable contents then construct your dropdown based on that result

Similar Threads

  1. problem with binding functions to image load
    By Trillium in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 08 Mar 2010, 03:29 PM
  2. PHP Image Upload with Flash Editing
    By oddball25 in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 15 Dec 2009, 04:19 PM
  3. Resizing an image through PHP
    By 0_o in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 16 Apr 2006, 05:26 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
  •