%
Set db = Server.CreateObject("ADODB.Connection")
set rs = server.createObject("ADODB.Recordset")
'
if request("action")="addalbum" then
if len(request("artist"))>0 then myArtist=request("artist") else myError="Please enter the artist this album belongs to."
if len(request("Description"))>0 then myDescription=replace(request("Description"),"'","þ")
if len(request("Title"))>0 then myTitle=replace(request("Title"),"'","þ") else myError="Please enter a title of the album."
if len(request("Image"))>0 then myImage=replace(request("image"),"'","þ")
if len(request("thumbnail"))>0 then myThumbnail=replace(request("thumbmail"),"'","þ")
if len(request("buylink"))>0 then myBuyLink=request("buylink")
if len(myError)<1 then
response.write "Adding Album... "
db.execute("INSERT into albums (artistid,title,description,image,thumbimage,buylink) VALUES ('" & myArtist & "','" & myTitle & "','" & myDescription & "','" & myImage & "','" & myThumbnail & "','" & request("buylink") & "')")
set rs=db.execute("SELECT last_insert_id() FROM albums")
albumid=rs("last_insert_id()")
rs.close
response.write "Done."
x=1
DO until x>=21
if len(request("title" & x))>0 then
response.write "Adding Songs... "
db.execute("INSERT into songs (albumid,track,title,listenlink,watchlink,length) VALUES('" & albumid & "','" & request("tracknumber" & x) & "','" & replace(request("title" & x),"'","þ") & "','" & request("listenlink" & x) & "','" & request("watchlink" & x) & "','" & request("length" & x) & "')")
'response.write request("title" & x) & "
"
response.write "Done."
else
'x=50
end if
x=x+1
LOOP
end if
end if
if request("action")="" OR len(myerror)>0 then
if len(myerror)>0 then response.write "Error: " & myError & "
"
%>