Jump to content

Pixle location of Image when Clicked


onlyican

Recommended Posts

hahahaha, this is gonna be fun I think

Going to
http://onlyican.com/images.php
You will see an image
and if you play with the form at the bottom, u see that depending what you select, it makes a box turn black

This is using GD LIB
The orig image (green with the yellow stripes) is one image
THe black box is another image

What I am looking for, is if someone clicks on that image, for me to find out the image pixle location of where they clicked

I dont want the geographical location of the click (where 0,0 is the top left of the screen)
I need it to be the image location
(where 0,0 is the top left corner of the image)

I think this is client side scripts (Javascript), as I dont think it can be done in server side scripting(php)

By the way, You may have guessed. I am using php
Link to comment
Share on other sites

If you use the image itself as a submit 'button', then php will pass the x and y co-ordinates (relative to the upper left corner of the image) of where it was clicked as the 'name' values of the submit button, i.e. $_POST['submit_x'] and $_POST['submit_y']
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.