Ajax Rating
Posted: Wed Mar 02, 2011 3:13 pm
Hello dear friends,
I've problem with one of ajax rating script that send id value as rating value however i also need it to send another variables which i'm going to store it in database
here is the code if you didn't understand what i've said
My Problem is with that code at
it sends name as value from
Now clear i've both id and name
and i've decide to send name as rating value
now how i can make it also send the value of id ?
here is the php file code which should get the value of name and add it to database
it is very clear it tame the coming value as $name
so my problem how to send also id ?????????
thanks in advance
I've problem with one of ajax rating script that send id value as rating value however i also need it to send another variables which i'm going to store it in database
here is the code if you didn't understand what i've said
Code: Select all
<script type="text/javascript">
// <![CDATA[
$(document).ready(function(){
$('#loader').hide();
$('#inner').children().click(function(){
var a = $(this).attr("name");
$.post("rating.php?value="+a,{},
function(response){
$('#inner').fadeOut();
$('#inner').html(unescape(response));
$('#inner').fadeIn();
setTimeout("hideMesg();", 2000);
});
});
});
function hideMesg(){
$('.rating_message').fadeOut();
$.post("rating.php?show=1", {},
function(response){
$('#inner').html(unescape(response));
$('#inner').fadeIn('slow');
});
}
// ]]>
</script>Code: Select all
var a = $(this).attr("name");
$.post("rating.php?value="+a,{},Code: Select all
<div class="rating_dis" name="<?php echo $k?>" id="<?=$id?>"> </div>and i've decide to send name as rating value
now how i can make it also send the value of id ?
here is the php file code which should get the value of name and add it to database
Code: Select all
if($_REQUEST['value']){
$name = $_REQUEST['value'];
$query = "insert into rating (rated, channelid) values ('$name', '$id')";
mysql_query( $query);
}so my problem how to send also id ?????????
thanks in advance