asp request.form

I have a form that posts and shows results from a database.
when the page asks for another 5 more, the url adds the url and the query parameters to the list.
By the time I click next 2 times, it adds the full url again and I end up with the form variable twice.
For example. I get id=618408&id=618408.
Then my script doesn't work anymore because request.form("id") comes in as 618408,618408.
is there a way i can set up that no matter how many times it's listed,  i should only get the first one?
rivkamakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Some code would be helpful
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You should have a link something like below.  Just know the code I have is for testing.  In real world, you would want to scrub your request("something") instead of sending right to the db.


< a href="page.asp?id=<%=request("id")%>&page=<%=cdb(request("page"))+5%>"> Next</a>
0
rivkamakAuthor Commented:
right now it's set up with tons of extra code that dreamweaver put in automatically.
it looks like dreamweaver says , 'whatever was there before and then new fields again'.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

GaryCommented:
Do you have a link to the page. Without this or some code it's just a guessing game
I suspect you may be missing a slash from the beginning of the href tag.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Which version of dreamweaver do you have?  mx/cs3 or cs4,5,6?  The 2 groups handle the automated stuff differently.  I would also suggest a little handcoding to create a faster db loading and paging.  That can come later.
0
rivkamakAuthor Commented:
Let me rephrase the question.
If my url says index.asp?id=618&id=618.
is there a way to request.querystring("id") should only return the first id and not both?
0
GaryCommented:
Why hack a problem instead of fixing it? This will only likely lead to further problems down the line.
What is wrong with posting some of your code or a link?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
When you have a query string with the same variable like, id= 618408&id= 618408, then your data comes back as a comma sepratated value.  This how checkbox values are used.

x=request.querystring("id") ' x= 618408,618408

You would would use the data as an array and probably loop like this

' option 1 when you don't know how many values there are
x=request.querystring("id") 
myArray=split(x,",")
for each theID in myArray
     response.write theID &"<br>"
     ' or update your db or ?
next

' option 2 when you know how many values there are and in this case 2
x=request.querystring("id") 
myArray=split(x,",")
x1=myArray(0)
x2=myArray(1)

Open in new window


If you only want the first value, then use something like

dim myValue
myValue=0 ' if no data, we set the value to zero
x=request.querystring("id") 
'lets make sure we have clean data. In this case we are expecting a number.
if len(x)>0 then ' we know we have data
     if isnumeric(x) then ' we know we have good data
          myArray=split(x,",")
          myValue=myArray(0)
     end if
end if

Open in new window


As Gary stated, this is a hack of solution where we may be putting a bandaid on internal bleeding.  The original code probably needs to be fixed up instead.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.