Forward Posted Form Data

M

Mark Watkins

suppose I have the following:

-----------BEGIN page1.asp----------
<form method="post" action="page2.asp">
<select name="someData" size="1" class="smallbutton">
<option value="1">Whatever</option>
</select>
'and a submit button
</form>
----------END page1.asp--------------

-----------BEGIN page2.asp----------
aVariable = Request.Form("someData")

<form method="post" action="page3.asp">
<select name="someOtheJjunk" size="1" class="smallbutton">
<option value="1">Whatever</option>
</select>
'and a submit button
</form>
----------END page2.asp--------------

Is there any kind of way to forward "someData", whch was
posted into page 2, to page 3 without making it more form data in page2. I
pretty much want to just be able to do something simple in page 3 like this:

-----------BEGIN page3.asp----------
anotherVariable = Request.Form("someData")
----------END page3.asp--------------


Thanks in advance.
 
R

Roland Hall

:
: suppose I have the following:
:
: -----------BEGIN page1.asp----------
: <form method="post" action="page2.asp">
: <select name="someData" size="1" class="smallbutton">
: <option value="1">Whatever</option>
: </select>
: 'and a submit button
: </form>
: ----------END page1.asp--------------
:
: -----------BEGIN page2.asp----------
: aVariable = Request.Form("someData")
:
: <form method="post" action="page3.asp">
: <select name="someOtheJjunk" size="1" class="smallbutton">
: <option value="1">Whatever</option>
: </select>
: 'and a submit button
: </form>
: ----------END page2.asp--------------
:
: Is there any kind of way to forward "someData", whch was
: posted into page 2, to page 3 without making it more form data in page2.
I
: pretty much want to just be able to do something simple in page 3 like
this:
:
: -----------BEGIN page3.asp----------
: anotherVariable = Request.Form("someData")
: ----------END page3.asp--------------

You cannot retrieve a variable's value from a page header by using
Request.Form any other way than METHOD=POST from a form where ACTION=
targets the page you're retrieving. So, I see two possibilities without
using cookies, files, etc.

Hidden field inside a form.

page2.asp
.... inside form ...
<input id="someData" name="someData" type=hidden value="<%=aVariable%>" />

OR

You could use a session variable.

page2.asp
Session("aVariable") = Request.Form("someData")

page3.asp
anotherVariable = Session("aVariable")

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.
-Technet Knowledge Base-
http://support.microsoft.com/default.aspx?scid=fh;EN-US;kbhowto&sd=TECH&ln=EN-US&FR=0
-Technet Script Center-
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/scriptcenter/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
 
A

Alex G

If you want to use Request.Form in page 3 then you will have to
forward it using form variables. If you don't need to use Request.Form
you could use Session Variables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top