Request.Querystring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • colinod
    Contributor
    • Nov 2007
    • 347

    Request.Querystring

    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.Queryst ing 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

    Code:
    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.c o.uk

    there is a similar thing using php at www.anothertong ue.com

    Any help please
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    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

    Comment

    • colinod
      Contributor
      • Nov 2007
      • 347

      #3
      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

      Comment

      • jenkinsloveschicken
        New Member
        • Dec 2006
        • 56

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

        Code:
        shortlist.asp?mp3id=firstid,secondid,thirdid
        In the shortlist.asp script you would just need to process the variables like so:

        Code:
        '''Assign GET variable
        str_mp3 = Request.QueryString("mp3id")
        '''Process str_mp3
        str_mp3Proc = Split(str_mp3,",")
        This will create an array str_mp3Proc. You can then loop through the array to create your list.

        -Best Regards,
        Jenkins

        Comment

        • colinod
          Contributor
          • Nov 2007
          • 347

          #5
          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

          Code:
          Do Until(str_mp3Proc.EOF)
          If Not str_mp3Proc.EOF Then
          response.write "yaketyRecordset("mp3id")"
          str_mp3Proc.MoveNext
          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

          Comment

          Working...