View Full Version : transferring data to asp
BCRandCo
10-30-2008, 09:06 PM
I'm trying to keep e-mails off my web page. I have a form to submit questions and depending on the name/link clicked a number is transferred to the asp which refers to specific e-mails listed in the asp file as em1, em2, em3.... My question is how do I convert that number to a file name, whose content becomes the "to" e-mail in my asp form, i.e. 2 is transferred, so now email=em2, if three were transferred, email= em3, etc. - sort of like the js eval("em"+3) function. Can I work with arrays in VB script in asp?
Thanks
Michael
hinch
10-31-2008, 12:46 AM
ok your description sucks but I think I know what you mean.
In your form post to your process page you pass a variable (we'll call it ID for this demo)
so on your process page you want to do this.
emailid = request.form("ID")
The you have 2 choices you can either have a load of if statements or you can do a select case I'll show you both you can take your pick what you use.
if emailid = 1 then
toemailaddress = "joe@blogs.com"
end if
if emailid = 2 then
toemailaddress = "steve@blogs.com"
end if
repeat if statements as you see fit/until you run out of numbers you've used.
Select Case emailid
Case 1
toemailaddress = "joe@blogs.com"
Case 2
toemailaddress = "steve@blogs.com"
Case Else
toemailaddress = "generic_info_address@blogs.com"
End Select
then in your send email function or whatever you just use the variable toemailaddress as surprisingly your "to" email address and voila all working etc
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.