By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,868 Members | 1,974 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,868 IT Pros & Developers. It's quick & easy.

Help with session variables

100+
P: 347
I have a shopping cart type of thing on my website where you can shortlist mp3's and then email the list to another person.

can be seen here

http://www.yaketyyakallmouth.com/flu...&voicetype=All

you can see the list of mp3 and shortlist button this all works fine but i am now trying to add the facility to shortlist an artist and not a clip, i have a shortlist button at the top this works and adds the artists id number to a seperate session variable.

My problem is i have been asked if i can record the voicetype selected on the artists page at the top where it changes the clips on the page so when the link is emailed and you will receive a link to the artist page it will take you to the voicetype you had selected when you shortlisted them

the asp code is

Expand|Select|Wrap|Line Numbers
  1. <%
  2. if InStr(session("recordsInCart"), ","&request.form("recordNum")) = 0 then 
  3.    session("recordsInCart") = session("recordsInCart") + request.form("recordNum") &","
  4. else 
  5.    'do nothing
  6. end if 
  7. %>
  8. <%
  9. if InStr(session("artistsInCart"), ","&request.form("artistNum")) = 0 then 
  10.    session("artistsInCart") = session("artistsInCart") + request.form("artistNum") &","
  11. else 
  12.    'do nothing
  13. end if 
  14. Response.Write(session("artistsInCart"))
  15. %>
form that adds the artist to shortlist is

Expand|Select|Wrap|Line Numbers
  1. <form action="boys2.asp?id=<% Response.Write yaketyRecordset("idnumber") %>&voicetype=<% Response.Write (voiceid) %>" method="post">
  2.       <input type="hidden" name="artistNum" value="<%=yaketyRecordset("idnumber")%>">
  3.       <% if InStr(session("artistsInCart"), ","&yaketyRecordset("idnumber")) > 0 then %>
  4.       <span class="shortlisted">SHORTLISTED</span>
  5.       <%else %>
  6.       <INPUT type="submit" alt="Add to shortlist" border="0" value="SHORTLIST">
  7.       <%end if%>
  8.     </form>
form that adds mp3 to shortlist is

Expand|Select|Wrap|Line Numbers
  1. <form action="boys2.asp?id=<% Response.Write yaketyRecordset("idnumber") %>&voicetype=<% Response.Write (voiceid) %>" method="post">
  2.       <input type="hidden" name="recordNum" value="<%=yaketyRecordset("idnumbermp3")%>">
  3.       <% if InStr(session("recordsInCart"), ","&yaketyRecordset("idnumbermp3")) > 0 then %>
  4.       <span class="shortlisted">SHORTLISTED</span>
  5.       <%else %>
  6.       <INPUT type="submit" alt="Add to shortlist" border="0" value="SHORTLIST">
  7.       <%end if%>
  8.     </form> 
my asp is good but im a bit lost with this and am sure it must be possible

any help thanks
Jun 26 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.