Solved

How to detect calling Form submission in ASP

Posted on 2008-10-17
3
374 Views
Last Modified: 2010-05-18
Hi Experts,

I know I'm going to kick myself on this, but I'm having to switch back to ASP for the first time in ages and can't for the life of me remember how to detect in ASP which file, (HTML), has called another script, (ASP), with a form post.

The story is that there are a bunch of HTML forms in different directories and with different file names that all submit a form to the same capture_enquiry.asp script in the root of the site.  I'd like to be able to tell, in the capture_enquiry.asp script, which form/path+filename has been submitted in each instance and act accordingly depending on which form has been submitted.

I know I could do this by changing the form name in each of the HTML pages but that would mean modifying every one of the forms and there are about 30 of them so I'd rather just be able to detect the form submitted if possible?

Many thanks,
0
Comment
Question by:jammy-d0dger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 11

Accepted Solution

by:
flipz earned 250 total points
ID: 22742564
Request.ServerVariables("HTTP_REFERER") should do the trick. It should provide the full URL of the page submitting the request so you may have to parse out the exact page. Tested using a form GET - not sure about a POST but I wouldn't assume any difference.
0
 
LVL 9

Assisted Solution

by:deathtospam
deathtospam earned 250 total points
ID: 22745064
However using HTTP_REFERER isn't 100% reliable -- there are some browsers and versions that don't pass it along ( http://tinyurl.com/652npo ).

Unfortunately, the most reliable way to do it would probably be to add a hidden variable, unique to each form, to the form.  
0
 

Author Closing Comment

by:jammy-d0dger
ID: 31649761
Thanks experts.  Although the tinyurl link didn't work I have looked into it and seen that it does indeed seem that it isn't totally reliable.  But it does work for us here, so both answers are valid and useful.  Thanks very much.
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question