Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2012, 06:34 AM
Registered User
 
Join Date: Nov 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default What (the heck!) is wrong with this?

Dim trademail
trademail = Request.Form("trademail")
Response.Redirect("help.asp?reminder=1&amp;tradema il<%=trademail%>")

...is producing the following error:

Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/reminder.asp, line 94, column 65

I want to add the form variable "trademail" to my querystring when directing back to my help.asp page.

I initially thought that this would work:
Response.Redirect("help.asp?reminder=1&amp;tradema il=<%=Request.Form("trademail")%>")
...but this produces the following error:

Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/reminder.asp, line 92, column 70

...so I tried this:
Response.Redirect("help.asp?reminder=1&amp;tradema il=<%=Request.Form(" & trademail & ")%>")

...but this takes me back to the Unterminated string constant error!

Would appreciate any advice as it's driving me to distraction now. Thanks.
NJ

Last edited by nathonjones; November 14th, 2012 at 06:38 AM..
 
Old November 14th, 2012, 05:51 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

You have ASP delimiters inside ASP delimiters. This will work:

Code:
<%
Dim trademail
trademail = trim(Request.Form("trademail"))
Response.Redirect("help.asp?reminder=1&amp;tradema il" & trademail & "") 
%>
note - you should always trim all request objects.
__________________
Wind is your friend
Matt
 
Old November 15th, 2012, 09:47 AM
Registered User
 
Join Date: Nov 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ta.

Thanks mat41. It should actually read...

<%
Dim trademail
trademail = trim(Request.Form("trademail"))
Response.Redirect("help.asp?reminder=1&amp;tradema il=" & trademail & "")
%>

...but we got the jist.

BTW... we have no idea why a space is being placed between the "a" and "i" in the word trademail. We've double checked what we've submitted, cut and pasted from Notepad to be sure, but there just isn't a space. Go figure.

Anyways, much appreciated. Thank you.
NJ





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this worded wrong or am I reading wrong? notig BOOK: Beginning Visual C# 2010 1 September 25th, 2010 01:51 PM
We're sorry, but something went wrong. barryjogorman BOOK: Beginning Ruby on Rails 3 July 11th, 2010 07:37 PM
Help me!Who can tell me where is wrong? kevinchen2004 C# 2 March 7th, 2005 06:22 AM
what the heck is a container?[:D] lcsgeek General .NET 0 January 24th, 2005 12:56 PM
Right or wrong? ÕÅÃÍ C++ Programming 6 February 27th, 2004 02:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.