I have a problem that I thought started out to be a javascript one, now I think it’s a PHP one…
I am calling a page using an old method of image mapping – the ismap tag… I need the ismap tag because I’m trying to get x,y coordinates from the image – I’m calculating Long, Lat coordinates off a map.
the html code I’m sending looks like this :
<a href=”mypage.php?otherstuff=otherstuff><img src=”mymap.png ismap></a>
what you see at the mouse is :
“mypage.php?otherstuff=otherstuff?100,200”
When I receive the page at mypage.htm, the javascript can parse out the url and I calculate the Long, Lat and pass everything back as :
“originalpage.php?x=100&y=200”
The tricky part starts here… I’m also having to pass a UserID. I was orginally passing it as a GET
“mypage.php?UserID=1&otherstuff=otherstuff?100,200”
but now I want to pass it as a POST so that someone can’t type their own url and come up with a different UserID.
I have successfully passed both POST & GET data together using javascript :
[code]
function SendSomewhere()
{
document.forms[‘MyForm’].action = “somepage.php?someval=someval”;
document.forms[‘MyForm’].UserID.value = UserID;
document.forms[‘MyForm’].submit();
}
and my form looks like this :
<form name=”MyForm” action=”” method=”post”>
<input type=”hidden” name=”UserID”>
</form>
However, I can’t do the same thing with the ismap tag… when you try to call a javascript function with the ismap tag the url looks like this:
“java script:SendSomewhere()?100,200”
clicking on it gives you nothing…
Is there a way to read “MyPage.php?100,200” in PHP?
Is there anyway to send it and still send POST data like I did with my javascript function?