Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing variables...

Status
Not open for further replies.

YodaMan81

Technical User
Jul 8, 2003
94
US
I am trying to pass a variable called into another variable called ID from one page to the next.
The variable is called "Acct"

So basically what I want is to use the following code and make it work:

<A HREF="newpage.asp?ID=Acct">

The thing is that the variable Acct has a number associated with it and I need that number to become the ID not the word "ACCT"

thanks for any and all help
 
what language?? (php/asp/jsp) The method is extremely dependant on context and language. Some more info will allow us to give you a better answer.

You'll need to use SERVER SIDE programming to do this. It can be done on the client side - but only in some browsers. hence bad.

One (php) example:
Code:
<A HREF="newpage.asp?ID=<?php echo($Acct); ?>">

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
In ASP

Code:
<A HREF="newpage.asp?ID=" & recordset("ID")>


buffalo.gif height="65" width="35"

 
You know I am not even sure if they are suppose to be .asp pages. I am sorry but I am really not very good at this at all.

How would this be using JavaScript?

Thanks a lot for all your help.
 
DON'T USE JAVASCRIPT!!

I cannot say it loudly enough: DO NOT USE JAVASCRIPT!

client side technologies cannot be consistently relied upon. For the effort required to integrate an asp/psp/jsp/cfm page, anything requiring a variable in this way should be using a dynamic server backend.

YodaMan81 - if you tell what you're trying to achieve, tell us about the app, or tell us about the technology, we can make suggestions that should help.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
jejeje.. manarth, use:

<scream>DO NOT USE JAVASCRIPT!!!</scream>

looks good, isn't it? jejeje

YodaMan: that kind of values can be passed ONLY with server-side scripting, not user-side. In order to get that you can use asp, php, jsp, cfm, etc. but not javascript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top