Click to See Complete Forum and Search --> : ASP form: Forgot something vital, help!


Mike25
05-19-2009, 04:39 AM
Hi all,

I've created a feedback form in ASP for solutions that I have on a software support website. The idea is that people will view the solution, and have the option to click a link which opens the form from another website. They then fill in the form and on submit the form is emailed to me.

The reason for this approach is that the solutions are on a SalesForce online helpdesk and I can't upload my feedback form on that server. So I can only put a link to a form on a website I can control.

The problem is that if a person clicks a link to open the feedback form from a certain page containing the solution, how will the feedback form know from what page/solution this feedback is to be about?!

I need a way of extracting the URL (at the very least) from the originating page. The solution title would be even better but since my feedback.asp and thankyou.asp files are already tested and working live I'd love to find a solution which wouldn't involve starting from scratch.

Thank you
Kind regards,

Mike

yamaharuss
05-19-2009, 06:44 AM
If you are allowed to place a link on the site why not use querystrings in your links?

http://www.mysite.com/myform?Q=Type1

Mike25
05-19-2009, 08:52 AM
Hi yamaharuss,

I think I forgot to mention something very important in my first post. I'm very new to ASP! :o

I'll need a bit more instructions. :)


If I'm on the support website and the solution page has this link:

https://{websiteA}.com/{alphanumeric characters}


On this page, I insert a link to my feedback page:

http://{websiteB}.com/feedback.asp


What I need is a way to get the alphanumeric characters portion of the link from websiteA reported in my feedback.asp form so that when I click on submit, it's another value that is emailed back to me.

Is there a way of doing this with query strings?

Many thanks!

Mike25
05-19-2009, 09:42 AM
I figured it out.

As a suffix to my link I've added ?key={solution_title}

In feedback.asp I've added:

<INPUT TYPE=HIDDEN NAME="key" VALUE="<%=Request.QueryString("key")%>">

In thankyou.asp:

Dim key
key=Request.Form("key")

And in the output to HTML code I've just added & key & to my line: "Feedback received for solution: "


It works great! Thank you for the suggestion yamaharuss. :)

namyaf
05-19-2009, 09:55 AM
Do the following to get the page:


<%

dim x

x = Request.ServerVariables("HTTP_REFERER")

Response.Write x

%>


Also, getting querystring values are very easy and basic. This is something that you can find all over the internet very easily as shown below:


<%

dim x

x = Request.QueryString("ID")

Response.Write x

%>