Connecting Tech Pros Worldwide Help | Site Map

Request.Querystring

colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#1: Sep 24 '08
I have a site that uses ASP and am trying to set up a feature where someone can add mp3 files to a list to email the list to someone through a form, i am having a problem getting more than 1 mp3 to list on the page, i thought that by using a Request.Querysting using a variable that stores the id numbers of all the mp3 you want to send and then adding that to the url it would work

code like this

Expand|Select|Wrap|Line Numbers
  1. shortlist.asp?mp3id=firstid,secondid,thirdid
this does not seem to work, i think it can be done with PHP but do not know how.

The idea is that i click a button next to the mp3 file listed to add it to a shortlist, then goto the shortlist page and email a link to the page with all the mp3 files selected relisted.

the website in question is www.yaketyyak.co.uk

there is a similar thing using php at www.anothertongue.com

Any help please
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 930
#2: Sep 26 '08

re: Request.Querystring


Hi colinod,

So what's the actual problem? Which bit of your code isn't working? Are you unable to retrieve the values correctly from the QueryString?

Dr B
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#3: Oct 31 '08

re: Request.Querystring


sorry for the delay, each mp3 file has an id number but when i load a page asking for the mp3 id numbers i am not sure how to code the link so that various numbers can be assigned to the field that contains the mp3 id so that i can call them in on another page
jenkinsloveschicken's Avatar
Member
 
Join Date: Dec 2006
Posts: 56
#4: Nov 1 '08

re: Request.Querystring


Not sure exactly what you are after here, but hopefully this will help. Using your code snippet from the OP:

Expand|Select|Wrap|Line Numbers
  1. shortlist.asp?mp3id=firstid,secondid,thirdid
  2.  
In the shortlist.asp script you would just need to process the variables like so:

Expand|Select|Wrap|Line Numbers
  1. '''Assign GET variable
  2. str_mp3 = Request.QueryString("mp3id")
  3. '''Process str_mp3
  4. str_mp3Proc = Split(str_mp3,",")
  5.  
This will create an array str_mp3Proc. You can then loop through the array to create your list.

-Best Regards,
Jenkins
colinod's Avatar
Familiar Sight
 
Join Date: Nov 2007
Posts: 182
#5: Nov 3 '08

re: Request.Querystring


Hi Thanks for the info i think this is what i am looking for, would i loop through this the same way as any other loop in ASP

Expand|Select|Wrap|Line Numbers
  1. Do Until(str_mp3Proc.EOF)
  2. If Not str_mp3Proc.EOF Then
  3. response.write "yaketyRecordset("mp3id")"
  4. str_mp3Proc.MoveNext
  5. End If
Not sure how to loop this if above is not correct, i am not very good with asp looping!!!
I gather when i get this to work it will return a list of the info held in the mp3id field seperated by the commas
Reply