/    Sign up×
Community /Pin to ProfileBookmark

passing params to a page that uses post instead of get.

lets say I wanted to link to a page like this:

<a href=”oneofmypages.asp” title=”Recent sites visited” target=”_blank” >PageTrack</a>

and wanted to pass a few parameters to oneofmypages.asp. Though, oneofmypages.asp uses post instead of get… so all of the logic on that page uses “request.form(vars)” (asp’s version of getting params from post) instead of “request.querystring(vars)” (asp’s get version of getting params from get).

I would normally do:

<a href=”oneofmypages.asp?var1=asdf&var2=asdf&var3=asdf” title=”Recent sites visited” target=”_blank” >PageTrack</a>

but since I’m using request.form(vars) on oneofmypages.asp, the paramets don’t get picked up. Is there a way to pass these vars so that oneofmypages.asp can use the params w/o also doing a request.querystring(vars)?

Thanks

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@ShortsJul 30.2009 — You'll have to use a form in one way or another.

The form could be hidden and submitted via JavaScript.

[code=html]
<form action="oneofmypages.asp" id="form_name" method="post">
<input name="var1" type="hidden" value="asdf" />
<input name="var2" type="hidden" value="asdf" />
<input name="var3" type="hidden" value="asdf" />
<a href="oneofmypages.asp?var1=asdf&var2=asdf&var3=asdf&" onclick="document.getElementById('form_name')submit();return false;">Page Track</a>
</form>
[/code]


Note, the document.getElementById('form_name')submit();return false; submits the form and then returns false (to stop the link from working). However, if the end user doesn't have JavaScript installed it passes the variables as querystring.
Copy linkTweet thisAlerts:
@mcruauthorJul 30.2009 — thanks, I guess that's what I'll have to do then
×

Success!

Help @mcru 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.18,
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,
)...