Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what would my link be?

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have a form on a website that I want a email sent to a user that would contain a link that would allow the user to pull up the same info in a update info page. These pages contain multiple records so I can't just pull up the info by ID. I want to pull the info up by "userID" and "Month" columns in the database that were just entered. What would the link look like that I sent through email?
 
Hi

If I am understanding properly you are simply allowing the email recipient to jump straight to the update page, in which case your link will look like this:


just like a standard ASP page. Be careful though, emails can turn a long line over and break your link in half, so keep your parameters as short as possible.

If you are concerned that you only want certain things to be shown on the page you can either add a "fromemail" parameter or just create another page Derren
[The only person in the world to like Word]
 
so where the xx are is where I would put like Month and userID. Those are the fields that I want to match for updating the record. So would m2 and m3 be what they put in? I am new to ASP programing and this is my first project. I guess I am trying to understand the syntax.
 
Yes, that's right.

First create your page to be used for editing. To show the right record you will need to have selected from your database using

Code:
"select * from table where month=yourmonth and userid=youruserid"

To ensure that you get the right record you would pass URL parameters to the page. These are name/value pairs which are added to the end of the url of the page. The first one always starts with a "?" and subsequent ones have an ampersand between them (
Code:
&
). For example:

Code:
yourpage.asp?month=jan&userid=53&frommail=y

So the url parameters sent to yourpage.asp are:

month=jan
userid=53
frommail=y

When the page receives these parameters you can use them to create your query by referencing them as:

Code:
request.querystring("month")

etc. etc. So you can now use these values in your page whenever you like.

The code I posted first has gone a bit awry because I forgot to put the code identifiers around it and it turned
Code:
&param2=[code] into [code]&para
+ m2= and that shows as a paragraph mark - D'oh!

Your link in the email should be something like:

Code:
[URL unfurl="true"]http://www.domain.co.uk/yourpage.asp?month=jan&userid=53&frommail=y[/URL]

Have fun
Derren
[The only person in the world to like Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top