Web Analytics Made Easy -
StatCounter ASP rating system - CodingForum

Announcement

Collapse
No announcement yet.

ASP rating system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ASP rating system

    Hi does anyone know how to create a simple rating system just like the ones on Amazon.com? I found a link which i tried and i think it is flawed. No attemp was made to provide the source files:

    http://www.devarticles.com/c/a/ASP/A...stem-With-ASP/

    Thanks

  • #2
    You can create a dropdown with 6 options (0-5).
    Each time someone rates an item, store the itemID and the rate value in a specific table.
    You can then make an average of the different rates (you can either round it or check the MAX value for the different possible rates) and display it with the item in question.

    hope I was clear?
    Alex
    yourmusicforums.com

    Comment


    • #3
      sorry you were not clear. Please can you provide me with some examples? thanks

      Comment


      • #4
        the link you provided in your first post, contains all the info you need. How to set up the database, How to create the neccesary pages, what code you need. All you have to do is read, copy & paste, adjust to your needs.

        (you have to read further then just the head of those pages)

        <edit>at this page you can even download a pdf version (ads-free) of the article</edit>
        Last edited by Roelf; Feb 11, 2004, 05:23 AM.
        I am the luckiest man in the world

        Comment


        • #5
          Perhaps you missed the link? (Hint: do a ctrl+f search for "Next:")

          http://www.devarticles.com/c/a/ASP/A...em-With-ASP/1/
          Former ASP Forum Moderator - I'm back!

          If you can teach yourself how to learn, you can learn anything. ;)

          Comment


          • #6
            Hi i have tried the script and this is the error i keep getting:

            <%

            dim conn
            dim rs

            set conn = Server.CreateObject("ADODB.Connection")
            set rs = Server.CreateObject("ADODB.Recordset")

            conn.Open "DSN=cds"
            rs.ActiveConnection = conn
            rs.Open "SELECT * FROM cds ORDER BY title ASC"
            while not rs.EOF
            %>
            <font face="Verdana" size="2" color="black">
            <h2><%=rs.Fields(1).Value%></h2>
            <b>Author:</b> <%=rs.Fields(2).Value%><br>
            <b>Summary:</b> <%=rs.Fields(3).Value%><br>
            <b>Price:</b> <%=FormatCurrency(rs.Fields(4).Value, 2)%><br>
            </font>
            <br>
            <form name="frmRate<%=rs.Fields(0).value%>" action="rate.asp">
            <input type="hidden" name="cdId" value="<%=rs.Fields(0).value%>">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td bgcolor="black">
            <font face="Verdana" size="1" color="white">
            <%
            for i = 1 to 10
            Response.Write "&nbsp;" & i & " <input name='rating' type='radio' value='1'> "
            next
            %>
            </font>
            <input type="submit" value="Rate It!">
            </td>
            </tr>
            </table>
            </form>
            <hr size="1" color="#08496B" NOSHADE>
            <%
            rs.MoveNext
            wend
            %>
            <h2><%=rs.Fields(1).Value%></h2>
            <b>Author:</b> <%=rs.Fields(2).Value%><br>
            <b>Summary:</b> <%=rs.Fields(3).Value%><br>
            <b>Price:</b> <%=FormatCurrency(rs.Fields(4).Value, 2)%><br>
            <form name="frmRate<%=rs.Fields(0).value%>" action="rate.asp" method="post">
            <input type="hidden" name="cdId" value="<%=rs.Fields(0).value%>">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td bgcolor="black">
            <font face="Verdana" size="1" color="white">
            <%
            for i = 1 to 10
            Response.Write "&nbsp;" & i & " <input name='rating' type='radio' value='1'> "
            next
            %>
            </font>
            <input type="submit" value="Rate It!">
            </td>
            </tr>
            </table>
            </form>
            this is the showcds.asp and the error is:

            Technical Information (for support personnel)

            Error Type:
            Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
            [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
            /TMPqtk9bsz9t4.asp, line 9

            and this is line 9:
            conn.Open "DSN=cds"

            i am following the script as listed prevoiusly. if u guys could try it as well and see if it works.

            Comment

            Working...
            X