Forum Moderators: coopster
What do I put in the .map file? I don't want to specify a URL for every single pixel, like
rect result.php?x=120&y=130 120,130 120,130
..I'm not even sure that that would work. For a 256*256 image, this would constitute 65536 lines in the .map file!
Can you suggest a short syntax which passes the x and y coords in a url?
Thanks
Dave Higgins
What you have to do is to apply javascript. I found some scripts, that get mouse position, however relatively to the whole page, not just the image.
here's the code taken from [codelifter.com...]
<script language="JavaScript1.2">
<!--// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false// If NS -- that is,!IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IEtempX = event.clientX + document.body.scrollLefttempY = event.clientY + document.body.scrollTop]} else { // grab the x-y pos.s if browser is NStempX = e.pageXtempY = e.pageY}// catch possible negative values in NS4if (tempX < 0){tempX = 0}if (tempY < 0){tempY = 0}// show the position values in the form named Show// in the text fields named MouseX and MouseYdocument.Show.MouseX.value = tempXdocument.Show.MouseY.value = tempYreturn true
}//-->
</script>
I hope this helps you somehow. If not, try posting this discussion at the javascript forum.
Best regards
Michal Cibor
And even the mirrors shall be on our side!
Question:
I'm trying to use an <input type="image"> tag, but the $foo.x and $foo.y variables aren't available. $_GET['foo.x'] isn't existing either. Where are they?Answer:
PHP and HTML FAQ [php.net]