Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    ASP




Passing Variables


This is hopefully a really simple issue... but what is the best way to pass a variable from one .asp page to the next?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Passing Variables
I'm trying to post variables using http to a site with a different domain and need my page to wait until it gets a returned value back and then insert that value returned into a database. Once I'm able to get the variable back i know how to get it into a database, just don't know how to have the page wait for the value returned.

Passing Variables
I am trying to write a search application which will allow a database holding a text to be searched.

To search the text the user has to select the act, the scene, the character
Right this is where it gets tricky!

The acts all have different scenes and the scenes all have different characters - so rather than try and attempt a very complicated linked combo box for the act, scene and character I figured a more sensible way of doing it would be to have the user enter the act they want to search on one page. The value of this would then be passed by form to the next page (to get the scene).

Based on the act selected a dropdown box is then populated with all the scenes for that particular act. Following on from this I then want to pass the scene selected together with the act selected on the previous page to the next page which will get the character. I can get the scene value passed through to the character page but not the act value as this is now a server side variable. Basically what I want to end up with is after the user has selected the character on the third page, I want to be able to use all this information to build an SQL search statement.

In case you are wondering why I decided to do it in this way, I initially tried the linked combo box method but found that if the user doesn't click the boxes in the correct order it causes problems with updating the box contents. Doing it this way I figured I can force the user to enter the information in the correct order. Code:

Passing Variables
Is there a way I can pass a javascript variable's value and use it in my asp code?

This is what I am doing:

I have a checkbox.

onclick="SelectView('course')"

javascript:

Function SelectView(course){
var course
course = 'course'
}

then in ASP (again)

if (javascript variable course = course) then
do something
end if

Passing Variables
I've got a form that has ENCTYPE="multipart/form-data" - this works great for getting a file from the user, however, no matter what I've tried, I can't seem to get any of my other fields passed to the next page. Here is an example:

<input type="text" name="lname" value ="<%= request.form("lname") %>"> I need the "name" field to be passed to the next page.

This if my form tag:

<FORM NAME="UploadFile" METHOD="POST" ACTION="UploadFileAck.asp" ENCTYPE="multipart/form-data">

I've tried an onblur when a name is entered, but it still doesn't recognize the lname field. Any ideas would be appreciated!!

Passing Variables
I hope I can explain this without much confusion.I have a search box on a site that contains 2 forms. One form is a search for Cities (via dropdown box) that goes to citylistings.asp. The other form is a search for Counties (via dropdown box) that goes to listings.asp.
Now I need to add the ability for the user put a Minimum and Maximum price in addition to the above. My problem is that I am unsure how to have just one set of price boxes for both forms. So that you can fill in the prices, and click Submit for either form, and the prices get passed.
You can view the page Here.
A guy who used to code in VB said that I should be able to declare variable, then when the user clicks on the box and types a value, the variable is set to that value. Then I can added hidden fields to the forms that are equal to the variables. Can I do this using ASP/VBScript.Or can I accomplish something similar?

Passing Variables
I have a function set up to send out an email. The function recieves parameters(email, subject, body). For some reason the function will only work if I change the function to accept only one parameter. ie. function imail(email).

Passing Variables!!
I am developing a website for our agency. My plan is to make a master-detail Page. In the Master page it will consist of 2 fields. 1. Project Status 2. Type of Project. and also it has a submit button. Once the submit button is click it will query my database based on the content of the two fields and it will be displayed in the detail page.

I am using Dreamweaver. I have tried their master detail page but it only can filter 1 field. also I have successfully connected to my database. Any suggestion on how will I ba able to accomplish my problem?

Passing Variables
I have an ASP project where I have users select or input values into a criteria page and then once they press "Submit" the ActiveX viewer displays the crystal report. All works fine and the criteria can be somewhat dynamic because the variables are used to build a SQL statement that is passed to the crystal report as the dataset.What I would like to do is create a variable on the Crystal report that will display the SQL statement or at least an English translation. This variable will be used to display the criteria of the report so end-users can see what criteria was used to generate the output of the report.

Passing Variables
I have a site that needs to look at an IFRAME for a login and search form but then break out of the IFRAME and pass all of the variables back into a page on my site.

For example:

Homepage (mysite)
Page with login IFRAME
Page with search form IFRAME
Search results (mysite)

How can I pass the variables from the search form IFRAME to the search results page?

Passing Variables
I know there has to be away to pass a variable from a .html page to a .asp page form field.The html page with the $name$ variable will be sent to a popup .asp page via a link on the html page.

The popup window (ASP page) is where a user would see a form field to enter there telephone number, a drop down for their carrier, and of course a form field with the $name$ variable already populated.Kind of a send this to my phone deal.

Passing Variables
Im working on a form that needs to submit the contents i.e. username password etc to itself then response.redirect to another form. How would i pass through the value of the username to the next form when i use the response.redirect code to get to the next form?

In the past i would add the contents of the previous form when the second form is opened, but with this i want to submit the contents then open the next form with the username stored in a hidden field or somthing similar.

Passing Variables
Am trying to pass a variable between an ASP page to a form. Its doing fine in a textarea box but only the first word of the variable (multiple words) is shown in a text box.

code to pass the variable:
<a href="form.asp?title=<%=title%>

code to catch my variable in my form (with a query request at the top of the page):
<input type="text" name="t3" size="40" value=<% If title <> "" Then Response.write title %>>

Ex: If I click on this Ttile I will get this: form.asp?title=Last%20Temptation%20of%20Chrsit.I will have only the "Last" word in my t3 form box. So what do I need to do to get all the title written like this in a box: Last Temptation of Chrsit?

Passing Variables
I've got a form where a user enters some info, which is then added to a database. On the next page I'd like to be able to call that record and display some of the info. Here's the problem - the only unique identifier for the records that are added is the 'ID' field that is an automatically assigned primary key in the database. That's the field I really need to show, but I have no idea how to do that.

So, just for clarity's sake, here's the progression that I'd like to see (or some version of it):

1. User fills out form, clicks submit.
2. Info is added to database as new record
3. User is taken to new page, where the ID that was assigned to that new record in the database is displayed.

Passing Variables
How to pass variable/variables between two asp pages?I am using Querystring but the problem is if i am having more than one word like "James Bond" then when i am trying to print it on another page then it is printing "James%20Bond".

ASP Passing Variables
I 'm writing an application that has two ASP pages. The first one lists out all the products and their description from the database, together having a text box next to each item for input of quantity. Like

Product1 Description1 (textbox1)
Product2 Description2 (textbox2)

The second would receive the item and quantity to calculate how much the total amount is.
how to pass the two variables item & quantity to the second ASP page.

Passing Variables
I have my index.html where I have two frames:

<frameset rows="144,*" border="0" frameborder="no">
<frame src="header.html" frameborder="no" noresize scrolling="no">
<frame src="rightFrame.html" name="frontpage" frameborder="no"
noresize>
</frameset>

I wanted the top of the site to stay in tact while the bottom constantly changes. With using this structure, I can't figure out how to pass variables from one page to another in the "frontpage" frame.

What I want is a jive, old list of links on a page within the "frontpage" frame that all point to the same page, but passes a specific category id to the next page so that it knows what data to display. Where I am confused is how to do this when the URL never
changes. Is there a way to set a session variable onClick? If so, how would I go about doing this?

Passing Form Variables In A Url
i think this is a simple process but i'm lost on how to format it
page.asp?cnum=Request.form("cnum")something like that?

Passing Variables From First Page To Third
I am currently creating a multiple page form where the information on
the first page needs to be validated. To do this, I have an asp page
between the 1st and second pages of the form. However, I need to pass
all of the information from the 1st page to the third (the second page
of the form) so that all collected information can be sent out in an
e-mail.

I thought about doing this with hidden form fields, but I don't know
if this is possible. I put a form with hidden fields on the
validation page, but I don't know how to make it forward to the proper
page after that without a submit button.

I have also heard of session variables, but I could not find too much
information on the topic.

Passing Variables Between Pages
I have a page that lists many records. One field in each record has a hyperlink based on the records ID. I click on this hyperlink and it sends me to another page and also sends the ID with it. How do I pull this ID and paste it on the new page. Below is the sending and receiving page and the code I have on each.

this correctly sends to new page with releaseID passed in the browser URL

Response.Write "<a href=""modifyCompleted.asp?releaseID=" & rsList("releaseID") & """>" & rsList("requestNum") & "</td>"

Shouldn't I be able to display the ID without connecting to the database.

<%
Dim ID
ID = Request.Form("releaseID")
%>
<%=ID%>

Passing Variables Between ASP And Javascript
I am using ASP to open a text file on the server and I want to pass
variables to Javascript. Any suggestions?

For example - I have a text file on the server defining a set of pictures.
I open the text file to retrieve the list of files. I want to pass the list
of files to the Javascript which will then display the data on the client
machine.

Passing And Displaying Variables In ASP
I have a page called PositionSearch passing the value 'Associate_ID' to frmPositionList. frmPosition list is a list of clients Associate 'X' has.

the table called tblAssociates contains all the information which I want to display in the Results (PositionList) screen. in this case i want to display "Intials" which is an actual field in tblAssociates.

Right now what this does it displays the Associate_ID. I want to be able to display the initials for Associate X

Associate_ID is being passed from frmPositionSearch and has a criteria of selecting an Associate from a drop down combobox Code:

Passing Variables Question
I have a variable which I would like to display on another page when the user clicks on a button I have created a form to do this but is there anyway which I can put the value into the form without the user having to type it in. I have already hidden the field but I just can't get the variable to pass to the other page, or would there be an easier way to do this.

Passing Variables For Searching
I am developing a search function for a website which utilises drop down menus which are populated by the users previous selection.

i.e. User selects from menu 1, which populates the 2nd menu..the user selects from the 2nd menu which populates the 3rd menu...there is then a submit button.

The submit button goes to an ASP page. I want this ASP page to take values selected in the drop down menus from the 1st page and search upon them in my MS Access DB.

Now I have the 1st page working, utilising javascript to search through arrays which store the data in the page. Code:

Passing Variables To New Page
I am trying to pass the values of a form to another page depending on what the user selects from the sample field. I have created a form where a user is inputting data to be displayed on the next page in the form of a business card (preview/proof)

When the user selects a sample I want the next page to be sampleone.asp, two etc but hold all of the data that the user entered. I have the following code in designit.asp but I want to pass all of the variables at once to samplexxx.asp in the form of a business card (table). Code:

When Passing Variables Through The Url, Exactly How Much Can The Url Hold?
Is there a limit to the length of the url? Is it browser dependent?

Passing ASP Variables With Javascript ??
I have a web site completely developed with .html pages.

My affiliate and ecommerce system are written in asp, as is the only registration page (register.asp).

If an affiliate sends a visitors to our registration page and the user decides to browse the site before registering we lose track of the affiliate id variable..

..Is there a way to pass a (one) variable between the html pages as the visitor browses the html based site and then have it passed to the registration page (register.asp)?

Also is there a method to set a cookie that retains this variable, and have it set to a one week expiration so that when the visitor returns to the site the most recently refering affiliate gets credit.

If passing of the variable is possible with javascript, can the javascript automatically check for the existence of the aforementioned cookie?

Passing Variables From One Asp Page To Another.
I would like to learn the syntax for passing variables that I retreived from
a database to a second asp page. Currently, I'm using:

Response.Write "<tr><td>&nbsp;</td><td><Font size= ""-1""><B><a href=
""InterviewerInfo2.asp?timeID=" & rs("Starttime") & " "">"

How do I add more variables to my link: <a href = ...?
ie Nameofcandidate and InterviewDate

in this context: Code:

Passing URL Date Variables
I am trying to pass two variables to an ASP page so I can display a coresponding crystal report. The variables are start_date and end_date. Here is the code:

Passing Variables Between Servers?
Here's the question: Can you use request.form to retrieve variables and values from a form submitted on a foreign server using the post method?

My understanding was that request.form could only retrieve values from the same web server the form was submitted to, using the post method.

I have another web master telling me this is how you pass information securely between "alien" web servers (web servers on different domains, or belonging to different organizations). For the life of me, I can't figure out how this might be done--or what the mechanism is for fetching the correct values from a foreign server!

Passing Variables From ColdFusion To ASP
Is there a way to pass a session variable from ColdFusion to ASP? I need to
pass one from the login page in ColdFusion to ASP pages so that I could
restrict access to the pages without login.

Passing Variables - Issue
Onclick of a button im calling the following javascript function,

function popit()
{

var str = showModalDialog("Dialog.htm");
}

and the returned value im storing it in the variable str(str will hold values like subsystem,problem_number,synopsis etcc..) How can i send this 'str' value to an another new asp page, where i can display the search result, based on this 'str' values.

Passing Session Variables
I'm trying to use session variables to maintain site security and thus use these variables to make comparisons to different fields, one of which is to compare a set access level to the access level assigned to the user. to do this im making a string comparison, and to make sure the varialbes are coming up the same im writing them out as well.

both are coming up on screen exactly the same but the comparison keeps producing a -1 ie not the same. i define one variable on the page and the other is the session variable, so im assuming its the latter that is causing the problem.

does anyone know what would cause this and how i can fix it? ive tried using the trim function just in case it was picking up whitespace but to no avail.

Passing Database Variables
I am connected to a database which is perfect, and I am displaying the values of the database on my initial ASP page which is cool aswell. However I am trying to also pass these values to other ASP pages. THus I am keeping away from opening up the database connection on the other pages to retrieve the same values.

I have been doing alot of searching on the net but it all seems to be about passing user input between forms. There is no user input in my site. I want to pass database values. I have been using the Form Get or Post methods but cant get it to work. Am I going the right way?

Passing Session Variables Frm ASP To JSP
Does anyone have experience with passing variables from an ASP page to
a JSP page.

The way it currently works in passing the SSN in the URL. This cannot
be good.

I thought that storing a unique session ID in a cookie and referencing
the SSN from the Session ID would be the correct way to do this. But
since we have two separate servers, IIS and Websphere, how do we
coordinate the session ID?

Perhaps I could write the session ID to a database table in the ASP
page, then requery it with the JSP page.

Passing Variables In SQL Statements
I'm working on a Calendar for my FrontPage web. I've been struggling interminably to write an SQL statement that only calls records based on a variable (today's date, in YYYYMMDD format).

Here's how I've declared the variable:

var mytext = (document.clock.thedate.value)

So now I write my SQL statement:

"SELECT * FROM cal_db WHERE Num_date = '" & Request.QueryString("mytext") & "'"

I know the query string is valid, since I can successfully execute a document.write command that correctly writes the string to my web page. But when I run the SQL, no results are returned.

Passing Variables From One Page To Another
I'm trying to pass a variable from one page to another and I keep getting an error.

Missing insert, delet, update...

Take a look at the attached files.

Passing Form Variables
I'm interested in knowing how to pass the form variables from page 2 to page 3

Page 1

Gathers info via a form from a person.

Page 2

Uses form variables from page 1 to decide what to do next, it then must pass some of the form variables from page 1 to page 3...

Page 3

Uses different Form variables from page 1 which it has been passed by page 2

Passing Variables Using Forms
I am trying to pass variables using a form. This page is a simple page that is used when an Admin is trying to delete a message from our message board. They click on a link which calls this page and sends the message Id to the page. This page only contains a form with one text box for the Admin to enter his/her password. The form needs to call another page passing the message Id and the password.

I am having trouble getting the form to pass the message Id along with the password. The message Id is being passed to the "password page" via the variable 'Id'. Here is the code I have.

<FORM METHOD="GET" ACTION="BoardDelete.asp?Id=<%=Request.QueryString("Id")%>&">
Admin Password:
<INPUT TYPE=TEXT NAME=pwd SIZE=25>

<INPUT TYPE=SUBMIT>
</FORM>

Passing Variables Via Url With Named Anchors
I am trying to passing some variables via the url and also a named anchor appended to the end. unfortunetely the named anchor is been read in as part of the last variable.

threads.asp?t=96&f=15&j=y#288

I use request.queryString("j") to retrieve the value but the value returned is y#288 and no y as expected.

Is there anyway to fix this problem.

I can't pass the value via a form.

here is the code I use to create the url

Code:

Passing Variables To Stored Procedure
I have an asp search page that passes the variables to a stored procedure for sql server. whenever i have a blank variable (like searching for last name only), i get this error:

Line 1: Incorrect syntax near ','.

This is my code for the page:

<%
lastname=Trim(Request.QueryString("LastName"))
firstname=Trim(Request.QueryString("FirstName"))
strSQL = "EXEC sp_HCDAIS_BanSearch "& lastname & ", " & firstname
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSQL, conn
%>

........

Passing Form Variables Using Frames
Using DW 8 with 3 frames. I want click on whatever in top frame that uses Go To URL which displays results in bottom frame. My problem is that the results in the bottom frame actually runs a recordset (SQL query) that pulls variables from various form elements in the middle frame.

The middle frame never submits the form variables to the server. It only serves as a resource for the getting variables used in the SQL statement. How do I go about addressing variables in the SQL statement ?

Passing Variables To A Launched .exe File
My situation is this: I run some servers, which i own and have full access to, for friends to play games on. Currently i use terminal services to access the machines( win2Kservers ) to start and stop and reset and change maps.. etc..etc I decided I'd like to have some control in a web browesr to make things a bit easier- ha! I thought this would be an easy thing to cut my teeth on. well here is my script so far: Code:

Passing Multiple Sets Of Variables Into SQL
Before I created this thread, I've searched Google and used the search feature of this forum numerous times on how to do this, but couldn't find much.

Basically, I'm trying to pass multiple sets of values from the search form to the ASP into an SQL statement (Access Database).

I can only make it display different prices of a certain music type, eg all prices of rock. But it doesn't output all types of music for certain prices, eg viewing Classic and Rock records with prices of 8.99 and 10.99 only.

I've used the REPLACE command I've found and got around that problem of syntax with numeric/alpha data. Code:

Passing Variables Through Frames On An ASP Site ?
I want to know the best way of passing on variable contents on a site
coded in ASP using frameset/frame. Content is used in all frames for
stuffs like screen_resolution, language, ...

My client's site is visited by Netscape 4.x/6.x and IE-5.x/6.x. It's
being converted to ASP and currently using frames (middle frame has a
vert scroll bar).

-I tried using Session("xxx") but in Netscape (4.x), it opens up a new
Session-ID for each frames. Therefore I cannot store variables in a
session when it's Netscape.

-I tried passing on variable contents using http://...?xxx=124&yyy=...
but I'm finding that I may have to have a long list of variables to
pass on this way.

-I was thinking about using SQL to store infos but then I cannot have
a unique record because of not having unique SessionID in all frames.

-Maybe there is a way of re-using the same session as the frameset for
each frames ?

Passing Variables To Include Files
Is there a way i can send variables to an included page other than the session. I know about doing it via the session but i find that a bit messy and it might affect system performance.

can i use
server.execute (my.asp?id=6)
or something similar ?

I have to include a menu on the side of every page that looks different depending on what page is being displayed so i need to find a way to do this properly.

Numpty Question About Passing Variables
I get the users IP using the following..

sip = Request.Servervariables("REMOTE_HOST")
What would i need to do to pass this to another page as a form variable?

Also I have a session variable set using the following..

Session("DiscountAmount") = rs("discountamount")
Again what would i use to pass to another page as a form item?

I am passing them to a form as it has to go off to a cgi script run on my payment provider.

Passing Variables Between ASP Scripts And Javascript?
Has anyone had success passing variable data between ASP scripts and Javascript?

Passing Variables Between Pages Using POST
I having trouble with this action cause I want the user to be able to use the back button and the submitted data should be still in their form. So I the user send invalid data he can back browse and change the invalid data. I use method=POST cause its a lot of data i send between pages + client is IE6 ...

Passing Variables In Hidden Fields
I am passing variables in hidden form fields and have got it working fine. However, if the variable value has a space in it then Request.Form("fieldname") only returns the first part of the variable upto the space and the remainder is lost.

I can pass such variables in the URL using URLEncode (and a URLDecode function) but this particular form is posting to the same page. Do I have to do some kind of encoding again to format the space properly and then decode it again?


Copyright © 2005-08 www.BigResource.com, All rights reserved