need help with simple asp code (1 Viewer)

NPUser

Registered User.
Local time
Today, 07:47
Joined
Jul 25, 2004
Messages
55
Basic idea - pass one variable to test.asp page and have user add second variable (input form) on same page and pass that as new url to process on the same page (same page is the key).

initial pass:
http://localhost/test.asp?req=22


once "Submit" is clicked new post url is created like this
http://localhost/test.asp?req=22&txtL=test000
and everything appears to be ok upto this point.

Now the problem is once i checked the post method with IF statement, i would like grab two variables pass from the last submit and return values so i can pass it to my ado connection string, but for some reason i am unable to get any values from statements below.

Hope this make sense. any help highly appricated.


if (Request.ServerVariables("HTTP_METHOD") = "POST") then
i= Request.QueryString("txtL")
j= Request.QueryString("req")







<html>
<body>


<form action="test.asp?req=" & id & "&txtL=" & txtLast method="POST">
<input type="text" name="txtL" value="<%= Request.Form("txtLast")%>"><br>
<input type="hidden" name="id" value="<%= Request.QueryString("req")%>"><br>
<input type="submit">
</form>

<%
if (Request.ServerVariables("HTTP_METHOD") = "POST") then
'PROCESS FORM

i= Request.QueryString("txtL")
j= Request.QueryString("Req")

%>


'test the variables
<td> "Test i:" & i </td>
<td> "Test j:" & j </td>

<%
end if
%>


</body>
</html>
 
Last edited:

NPUser

Registered User.
Local time
Today, 07:47
Joined
Jul 25, 2004
Messages
55
I used "GET instead of "POST". And now it is happy. Thanks
sa
 

Users who are viewing this thread

Top Bottom