Forum Moderators: open

Message Too Old, No Replies

How can we achieve this with ASP?

         

kriani

9:29 pm on Feb 8, 2007 (gmt 0)

10+ Year Member



Hello

Sorry for being vague in the title. I did not know how to frame the question.

I have an ASP page where a user enters his personal ID and the next ASP page pulls up his records from the database.

I want to know how we can achieve the following:

if a user types in www.myurl.com/compute.asp?id=123 he should be able to see his records just as before..

i want to know how we can add that users' id at the end of url with a question mark and get his records.

thanks in advance,
kriani

sgietz

12:06 am on Feb 9, 2007 (gmt 0)

10+ Year Member



This is for .NET --

Private Sub DoSomething(S As Object, E As EventArgs)
Dim url As String = "http://www.myurl.com/compute.asp?id="
Dim id As Integer = 123
Response.Redirect(url & id)
End Sub

Once you have the id, just append it to the url and do a redirect.

bmcgee

4:02 am on Feb 9, 2007 (gmt 0)

10+ Year Member



In the receiving form check Request.Form("fieldname")
If it exists, use it as your ID and load the data
If it does not exist, check Request.QueryString("id")
If it exists, use it as your ID and load the data
If it does not exist, redirect back to the first page where the user fills in their info.

txbakers

3:23 am on Feb 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only bad thing about doing it in a URL like that is ssecurity.

If someone knows someone else's ID, they could pull up all the records.

Better to have a login page where they validate with some type of password.

kriani

4:05 pm on Feb 14, 2007 (gmt 0)

10+ Year Member



thank you so much guys for the prompt responses.

@sgietz: im just using asp 3.0, but thanks for the idea.

@txbaker: what you said is totally right, but in my case it is not
that sensitive of information, so i guess i need not worry
(speaking of security, we have some kind of security seal
built into into the page; would that help to any extent?)

---------------------------------------------------------

here is what i have done:

i have checked for request.querystring and am able to use that value to retrieve data from the datastore, but I am having a problem with passing the values to the nextpage using response.redirect("nextpage.asp").

I read somewhere that querystring values cannot be used to pass values using response.redirect to the next page.

Is this true? if it is, is there any workaround for this?

(for temporary purposes, i have an interim page which asks users to press submit and proceed to the next page)

thanks in advance,
kriani