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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using variables with response.redirect 2

Status
Not open for further replies.

InternVirtuoso

Programmer
May 20, 2003
21
0
0
US
a quick question

when you are using response.redirect can you insert a variable into the URL?

for example:

---
dim temp
temp = 5
response.Redirect("test.asp?whatnum=temp")

---

how would I make the variable be inserted into the URL so that it would be "test.asp?whatnum=5" ?






 
the concatination character in vbscript is &
when you incorporate you variables into strings they need to be concatinated to them. The code will not be inpterpruted as a variable verses a string if all is enclosed in " "
so if you have a variable and string
Dim var, str
var = "this "
str = "and that"
concatinate as
str = "combined they equal " & var & str

_________________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sup] [/sub]
 
Simply:

response.Redirect "test.asp?whatnum=" & temp



Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top