Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    57
    Thanks
    4
    Thanked 1 Time in 1 Post

    where would i put the code to add to db

    ok im using this up/down script i found here
    http://www.shawngo.com/thumber-rating-script.php
    but it doesnt save the score in a db so i decided i would make one

    but im not familiar with javascript/ajax
    so where would i put the php to add the vote to the db

    would i put it in with one of the js files like voter.js?

  • #2
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i'm not ajax expert, but maybe it will help.
    Code:
    Voter = {
      vote : function(what_in){
    .....
    .....
    var myAjax = new Ajax.Request( 'vote.php', { method: 'get', parameters: pars, onComplete: this.showResponse })
    ....
    ....
    in code above 'vote.php', is in the same folder .


  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    57
    Thanks
    4
    Thanked 1 Time in 1 Post
    just to be clear, put it in a new file, vote.php
    and add that line to voter.js
    right?

  • #4
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    maybe only vote.php. (if not exist).

    for that line of code, i copy that code from
    http://www.shawngo.com/thumber-rating-script.php

    if you not change anything in voter.js,
    i believe it already there...




  •  

    Posting Permissions

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