Skip to main content
Inspiring
March 15, 2010
Answered

Pass a variable from a link to a mail form

  • March 15, 2010
  • 1 reply
  • 1081 views

Hello,

i have a site with several (plain html) pages for products, on each page there will be a "order" link.

Upon clicking the link it should reach a simple ASP mail form so the person can fill their data(it's a very simple ecommerce if you want) but the form should also send the product data/name(invisible) with it and show it on the contact form, ex "you are placing an order for product [product], please enter your contact details below".

in short, how do i pass a variable from the order link on the product page to the contact page(and display it) so that on submit it delivers the user-inputted fields along with the hidden product name.

thanks in advance,

G.L.

This topic has been closed for replies.
Correct answer bregent

so far i have the contact.asp and the resulting sending scrip working but i

don't know how to read the querystring and then pass it over to the form

post(and with what asp command to read that fixed/hidden data.

i've been reading through tag use and there's nothing in it to define hidden variables, tried with <%=Request.QueryString("id")%> in the form tag to no avail in contact.asp i have: Formulario de envio ]]>

<font size="5">Formulario de contacto asp</font>

</html


>i don't know how to read the querystring and then

>pass it over to the form post

To assign the querystring value to a local variable

DIM productID

productID = Request.QueryString("productID")

To include in the form:

<input name="productID" type="hidden" value="<% =productID %>">

1 reply

Participating Frequently
March 15, 2010

You need to pass it in the querystring:


orderpage.asp?ID=12345

Inspiring
March 15, 2010

bregent, yes, i got that far myself using GET.

but how do i transfer that varibale to the final script?

for example, i have:

product page with link: /contact.asp?productid=10

contact.asp has the input boxes for the user data with POST method to sendmail.asp AND must pass the productid to the email send script

sendmail.asp is the email sending script

i'm lost as to how to make the "contact.asp" page that reads and forwards the productid.

i've been googling for samples of mail scripts and variable passing forms but i'm lost as to how to glue them since the majority of email send examples use a HTML initial contact form.(being a total newbie doesn't helps much either )

bregentCorrect answer
Participating Frequently
March 15, 2010

so far i have the contact.asp and the resulting sending scrip working but i

don't know how to read the querystring and then pass it over to the form

post(and with what asp command to read that fixed/hidden data.

i've been reading through tag use and there's nothing in it to define hidden variables, tried with <%=Request.QueryString("id")%> in the form tag to no avail in contact.asp i have: Formulario de envio ]]>

<font size="5">Formulario de contacto asp</font>

</html


>i don't know how to read the querystring and then

>pass it over to the form post

To assign the querystring value to a local variable

DIM productID

productID = Request.QueryString("productID")

To include in the form:

<input name="productID" type="hidden" value="<% =productID %>">