X=, Y=
Here is the code
<?Php
$foo_x=$_POST['foo_x'];
$foo_y=$_POST['foo_y'];
echo "X=$foo_x, Y=$foo_y ";
?>
<form action='' method=post>
<input type="image" alt=' Finding coordinates of an image' src="xy-coordinates.jpg"
name="foo" style=cursor:crosshair;/>
</form>
Collecting the values of the coordinates of any image is a common requirement in many applications. For example if we have one map and wants the visitors to click on any area of the map to enlarge ( zoom ) it then we must know the coordinates of the click point where the visitor wants to be magnified.
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.
| Paco | 21-08-2012 |
| This was so helpful and saved me a lot of time. Thanks a lot. | |
| Dennis | 15-10-2012 |
| How would i use this method if i wanted to have 2 images that i want to click before the form posts? | |
| Mary | 05-04-2013 |
| it was so helpful! Thank you very much! ^_^ | |
| Mahesh Todkar | 22-08-2014 |
| This is really superb. now i dont need to use javascript for that and which helps me a lot and save my time as well. | |
23-04-2021 | |
| COOL TAHNKS | |