Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

is this possible ...(php)

Options
  • 15-03-2006 10:37am
    #1
    Registered Users Posts: 648 ✭✭✭


    Hi is this possible,

    I have a form where i want to capture details about an event.
    An image of the country is presented. When the user clicks on the image the coordinates of the click point at stored in a field.This is all saved to a mysql db.

    Then on the from end my php script will loop through all the events and read the coordinates and draw a little fugure (dot or something) and if possible create a link to this event.

    If anyone could point me in the right direction it would be really appreciated.


Comments

  • Closed Accounts Posts: 131 ✭✭cognos


    Yes this is very possible. Getting the coordinates of a mouse click can be done with javascript as can the setting the value of a form field on that event. The easiest way to do this though, would be if your map of the country was split up into areas (like counties or something) using an image map or by slicing up the actual image and then for each image(map) there would be a javascript onclick behaviour to set the value of the form field to the coordinates you have specified. (If you want it to be very specific though you should look at getting actual coordinates from the mouse).

    Then displaying these events can be done with absolutely positioned divs that contain your marker image (positioned over the map of the country). The XY vals come from the database. These divs are made in a loop thru the events dataset, so you get all the events positioned at the same time.

    You'll find the javascript easily enough on google, and the PHP bit is very straight forward.


Advertisement