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
https://forums.phpfreaks.com/topic/229423-post-2-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.