SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: ASP Playlist

  1. #1
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP Playlist

    What I'm trying to do is use ASP to create an asx file which plays music that is located on my server using a form.
    Can someone please help me?

    Here is my playlist2.asp file:

    Code:
    <html>
    <head>
    <title>Playlist</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <%
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
    Conn.ConnectionString = "Data Source=" & Server.MapPath ("/music/music.mdb")
    Conn.Open
    Set Rs = Server.CreateObject("ADODB.Recordset")
    Rs.Open "SELECT * FROM artists2 ORDER BY SongID ASC", Conn, 1,3
    action=Request.Form("action")
    Rs.PageSize=10000000
    %>
    </head>
    <body>
    <% if action=0 then %>
    <form action="playlist2.asp" method="post">
    <input type="hidden" name="action" value="1">
    <% do while not Rs.EOF and Rec < Rs.PageSize %>
    <input name="song" type="checkbox" value="<%=rs("songID")%>"><label for="song"><%=rs("song")%></label><br>
    <% 
    	rs.movenext
    rec=rec+1
    	loop
    %>
    <input type="submit" value="Add">
    <input type="reset" value="Reset">
    </form>
     
    <% elseif action=1 then %>
    <%
    Set Conn1 = Server.CreateObject("ADODB.Connection")
    Conn1.Provider = "Microsoft.Jet.OLEDB.4.0"
    Conn1.ConnectionString = "Data Source=" & Server.MapPath ("/music/music.mdb")
    Conn1.Open
    Set Rs1 = Server.CreateObject("ADODB.Recordset")
    Rs1.Open "SELECT * FROM artists2 WHERE songID IN (" & Request.Form("song") & ")", Conn1, 1,3
    %>
    <% do while not Rs1.EOF and Rec1 < Rs1.PageSize %>
    <%=Rs1("song")%><br>
    <% 
    	rs1.movenext
    rec1=rec1+1
    	loop
    %>
    <form action="playlist2.asp" method="post">
    <input type="hidden" name="action" value="0">
    <input type="submit" value="Reset">
    </form>
    <% end if %>
    </body>
    </html>
    Last edited by dlh1989; Apr 23, 2005 at 05:18.

  2. #2
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  3. #3
    SitePoint Enthusiast afgmail's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is your question specifically?
    Are you getting errors with this code?
    This code works and you're trying to modify it?
    Scan completed....
    Brain not found.
    filecabin.com : Notepad2

  4. #4
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I'm trying to do is create a playlist of songs that plays in any media player. It plays songs that is selected by the user through the form in the code above.

  5. #5
    SitePoint Enthusiast afgmail's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is the problem?, are you getting any errors with the code you have now?
    Scan completed....
    Brain not found.
    filecabin.com : Notepad2

  6. #6
    SitePoint Enthusiast dlh1989's Avatar
    Join Date
    Nov 2004
    Location
    Sunshine Coast, QLD, Australia
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No errors, all I want to know is how to create an ASX file with multiple songs that come from a form using ASP.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •