# ASP programmers: a little help, please?

**URL:** https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104
**Category:** Factual Questions
**Created:** [December 29, 2008, 7:34pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104 "2008-12-29T19:34:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![commasense](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/commasense/32/3017_2.png) [@commasense](https://boards.straightdope.com/u/commasense)
#### Post date: [December 29, 2008, 7:34pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/1 "2008-12-29T19:34:43Z")

</div>

I’m trying add [Recaptcha](http://recaptcha.net/) to the forms on my Web site to block the form spammers, and I found this pair of ASP scripts: [challenge1.txt](http://www.lfexaminer.com/challenge1.txt) and [challenge2.txt](http://www.lfexaminer.com/challenge2.txt).

I’ve been able to get them to work for a single page, but the internal comments indicate that you should be able to use the same script pair to handle multiple pages. Not being an ASP maven, I haven’t been able to figure out the syntax to make it work.

Could someone show me examples of how to do multiple pages?

(I’ve e-mailed the original author, but haven’t heard back yet.)

Thanks.

---

<div class="post-metadata">

### Author: ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)
#### Post date: [December 29, 2008, 8:06pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/2 "2008-12-29T20:06:30Z")

</div>

What exactly do you mean by “multiple pages”?

Do you mean you want it on different forms on your Web site?

---

<div class="post-metadata">

### Author: ![commasense](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/commasense/32/3017_2.png) [@commasense](https://boards.straightdope.com/u/commasense)
#### Post date: [December 29, 2008, 8:13pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/3 "2008-12-29T20:13:32Z")

</div>

Yes. The comments refer to using the “sending\_page” value to direct the script to different results pages, but I’m not clear how that has to be coded in either script.

---

<div class="post-metadata">

### Author: ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)
#### Post date: [December 29, 2008, 8:20pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/4 "2008-12-29T20:20:35Z")

</div>

Ok your forms are going to need a hidden field called sending\_Page

```auto

<input type="hidden" name="sending_Page" value="1">

```

That value (1) would be different for each form. Best to use 1, 2, 3 etc.

Then, see this line on challenge2.asp?

```auto

' If sending_Page=1 then response.redirect "where the correct url goes.asp"

```

Get rid of the ’ and make a copy of that line for each results page. For instance…

```auto

If sending_Page=1 then response.redirect "EmailContactThankYou.asp"
If sending_Page=2 then response.redirect "MailingListThankYou.asp"
If sending_Page=3 then response.redirect "CustomerSurveyThankYou.asp"

```

So, the form with the hidden send\_Page value of 1 will end up at the EmailContactThankYou.asp page, the form with the value of 2 will end up at MailingListThankYou.asp and the form with the value of 3 will end up at CustomerSurveyThankYou.asp.

Got it? Let me know if I need to be more clear.

---

<div class="post-metadata">

### Author: ![commasense](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/commasense/32/3017_2.png) [@commasense](https://boards.straightdope.com/u/commasense)
#### Post date: [December 29, 2008, 10:12pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/5 "2008-12-29T22:12:17Z")

</div>

Thanks, **ZipperJJ**

That’s kind of what I was thinking, and I tried something like that (I don’t have my versions in front of me right now), but it didn’t work. I’ll have a chance to try it out tomorrow, and will let you know.

Where in each script should these lines go?

---

<div class="post-metadata">

### Author: ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)
#### Post date: [December 30, 2008, 8:59pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/6 "2008-12-30T20:59:29Z")

</div>

I looked a little harder at the scripts, and looked on your site and I see the problem.

This line, on challenge1:

```auto

<input type="hidden" name="sending_page" value="<%=Request.querystring("sending_page")%>">

```

Is expecting that you have a querystring for the page that is showing the form. So for example, it is expecting subscribe.asp?sending\_page=1

If you make all of your links to subscribe.asp have that query, then it will pass the 1 to the form and the form will pass the 1 to challenge2 and then challenge2 will redirect the user to the page you specified on line 28 of challenge2.

The code I gave you, the If/Then stuff, should all go on line 28 (well, 28, 29, 30, etc) of challenge2. You’ll also need to change the links to every page you want to use the challenge to have their own query, sending\_page=# (each with a different number).

This is kind of a crap way to do a captcha…you’re not really protecting the form if you’re just using a captcha to get to the form. Anyone can bypass that. If you want, PM me and you can send me your pages and I will help you sort it out. It’s too much to explain here without boring our friends to tears.

---

<div class="post-metadata">

### Author: ![commasense](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/commasense/32/3017_2.png) [@commasense](https://boards.straightdope.com/u/commasense)
#### Post date: [December 30, 2008, 9:21pm UTC](https://boards.straightdope.com/t/asp-programmers-a-little-help-please/479104/7 "2008-12-30T21:21:15Z")

</div>

Thanks. Check your PM.
