how to pass variable value of 1.asp to

Results 1 to 3 of 3

Thread: how to pass variable value of 1.asp to

  1. #1
    Join Date
    Dec 1969

    Default how to pass variable value of 1.asp to

    retriving variable values<BR><BR>NOTE: I CANNOT USE SESSIONS SERVER DOES NOT SUPPORT SESSIONS<BR>i have 3 asp pages<BR><BR>1.asp<BR><BR>contains the form tag and the form fields...<BR><BR>2.asp<BR><BR>is the processing page..& showing results<BR><BR>2.asp has a page 3.asp(has the functions for the layout of 2.asp) in the include section like:<BR><BR>&#060;!-- #include file="3.asp" --&#062;<BR><BR>i have to written programme like this...<BR><BR>the 2.asp will request the text fields of 1.asp and<BR>checks whether the value is there or not. if there is no<BR> redirects back to the 1.asp. if there is value<BR>it should show results. the processing of showing results <BR>are stored in the function in the page 3.asp as it is a page which<BR>contains the layout for 2.asp<BR><BR>now....wat i want to do is: i want the value entered in 1.asp to be used in<BR>the function in the page 3.asp and show the results in 2.asp<BR><BR>ALERT: I CANNOT USE SESSIONS. IF I USE SESSION VARIABLES I CAN EASILY DO IT<BR><BR>without using session can i retreive the value <BR>which is typed in the text field of 1.asp in a function in the <BR>page 3.asp<BR><BR>i know that i have to use querystring...but how to use the querystring?<BR><BR>send me a short syntax.<BR>

  2. #2
    Rob Wolfe -PetSection.Com Guest

    Default RE: how to pass variable value of 1.asp to 3.asp..

    If you want to use a querystring;<BR><BR>on 1.asp <BR>x = value that you are passing<BR>&#060;form action="2.asp?name=x"&#062;<BR><BR>When this form is submitted it will go to 2.asp?name=x<BR><BR>To use this value on 2.asp simply:<BR>blahBlahBlah = &#060;%Request.Querystring("name")%&#062;<BR><BR>I f you wanted to passit to yet another page:<BR>&#060;form action="3.asp?name=&#060;%Request.Querystring("nam e")%&#062;"&#062;<BR><BR>-----------<BR>Alternatly the value can be passed using an input type of "hidden" and called back with request.form("name")<BR><BR>/Rob Wolfe<BR>

  3. #3
    David Mann Guest

    Default Perhaps this will help.

    Hi there. Perhaps I can shed some light on this for you. <BR><BR>One of the EASIEST ways to pass values around pages using query strings is to just append the values onto the end of a link. For example:<BR><BR>If you had this form on 1.asp:<BR><BR>&#060;form method="get"&#062;<BR>Your Name:&#060;input type="text" name="fName"&#062;<BR><BR>Your Favourite Colour: &#060;input type="text" name="fColour"&#062;<BR><BR>&#060;/form&#062;<BR><BR>And you wanted to grab that value in 3.asp and pass it back to 2.asp using the Request object, you could do this: <BR><BR>&#060;%<BR>&#039Begin sample code for 3.asp<BR><BR>Option Explicit<BR><BR>Dim sName, sColour &#039vars for your request results<BR><BR>sName = Request.QueryString("fName")<BR>sColour = Request.QueryString("fColour")<BR><BR>&#039Do your processing here; if the values are empty for these vars<BR>&#039then return the user to 1.asp, else continue to the processing <BR>&#039page.<BR><BR>If sName &#060;&#062; "" AND sColour &#060;&#062; "" Then<BR>Response.Redirect("" & sName & "&fColour=" & sColour)<BR><BR>&#039NOTE: When passing query strings, the first name=value pair is delimited after the link with a "?". <BR>&#039An "=" is used to separate the name=value, and all subsequent name=value pairs are delimited with an "&". <BR>&#039IMPORTANT!! You will need to URL encode any name=value pairs that have special characters in them!<BR>Response.End<BR>Else<BR>Response.Redirect ("")<BR>Response.End<BR>End If<BR><BR><BR>&#039End Sample Code<BR>%&#062;<BR><BR>I hope this helps. If you have any other questions, let me know.<BR><BR>Sincerely,<BR> --David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts