/    Sign up×
Community /Pin to ProfileBookmark

Reading ismap tags & POST data

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>
[/code]

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?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @sharyn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...