PROBLEM SOLVED!!!
HOW?
First of all the mistake is this one:
data: 'rate' + $('rate').val(),
what needs to get changed as you all told me right to:
data: 'rate='+rate, or data: {rate: rate},
but there is also another problem with my server settings as well which needs (I dont know the reason) an absolt URL to the php file instead a relative.
THANK YOU ALL FOR YOUR TIME AND YOUR KIND HELP!
I am having some trouble with an onclick element for a rating script. When a user clicks on one of those fields, the value should be send via an ajax post method.
<li id="rating-boxes-rate" onclick="rateFunction(1)"></li>
<li id="rating-boxes-rate" onclick="rateFunction(2)"></li>
<li id="rating-boxes-rate" onclick="rateFunction(3)"></li>
<li id="rating-boxes-rate" onclick="rateFunction(4)"></li>
<li id="rating-boxes-rate" onclick="rateFunction(5)"></li>
The javsscript code:
function rateFunction(rate){
     $.ajax({
         url: '../rate.php',                    //rate.php location in parent folder
         type: 'POST',
         data: 'rate' + $('rate').val(),
         success: function(html){
                     alert('Rating: ' + rate);          //just to check, will be deleted later
                     $('#message_success').html(html); //message div id located in my html to show the outcome
         }
     });
     return false;
}
At this point the alert gets shown correctly but unfortunately the data is not getting send to the rate.php which at this point is a simple echo statement for testing:
$rate = $_POST['rate'];
echo $rate;
Does anyone see where exactely my code is wrong? Thank you in advance.
 
     
     
     
     
     
     
    