Jump to content

Post 2 Variables


manalnor

Recommended Posts

Hello dear friends,

 

say i've form with 2 variables which i want to post to another file

 

file 1

 

<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>

 

this will post the following ( the value of name )

 

<div class="rating_dis" name="<?php echo $k?>" id="<?=$id?>"> </div> 

 

but i want it also to post the value of the (id)

 

here is the second file which should get the name

 

if($_REQUEST['value']){
$name = $_REQUEST['value'];

$query = "insert into rating (rated, channelid) values ('$name', '$idz')";
mysql_query( $query);
}

 

so the problem is how to send from file 1 to file 2 both the (name) and (id)

how to double this ?

 

var a = $(this).attr("name");
$.post("rating.php?value="+a,{},

 

to be also

 

var a = $(this).attr("id");
$.post("rating.php?any="+a,{},

 

then i can get it from file 2 easily get both.

 

thank you  :'(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.