Get a php variable back after an AJAX action?
When I click onto a button of my page, I do the following action :

    $.ajax({
	type: "POST",
	url: "index.php?module=pages&action=afficher_page&id=<?php echo $_GET['id']; ?>", 
	data:"vote="+vote,
	success: function(){
	alert("Vote done");
}

Then, the page of the url receive my POST variable to treat the vote:

    <?php 	
    // I get the timestamp of the last user's vote
    list($last_timestamp) = get_last_timestamp($_SESSION['id'], $_GET['id']);

    // I get the server timestamp
    $timestamp_click=time();

    if($timestamp_click-$last_timestamp > $time_limit){ 
       $authorization_vote=false;
    }else{
        $authorization_vote=true;
    }

I would like to get back and send $autorisation_vote to AJAX or jQuery in order to alert the user if his vote has been done. I heard about callback but don't succeed to adapt to my case. How do that ?


Get a php variable back after an AJAX action?
===

When I click onto a button of my page, I do the following action :

    $.ajax({
	type: "POST",
	url: "index.php?module=pages&action=afficher_page&id=<?php echo $_GET['id']; ?>", 
	data:"vote="+vote,
	success: function(){
	alert("Vote done");
}

Then, the page of the url receive my POST variable to treat the vote:

    <?php 	
    // I get the timestamp of the last user's vote
    list($last_timestamp) = get_last_timestamp($_SESSION['id'], $_GET['id']);

    // I get the server timestamp
    $timestamp_click=time();

    if($timestamp_click-$last_timestamp > $time_limit){ 
       $authorization_vote=false;
    }else{
        $authorization_vote=true;
    }

I would like to get back and send $autorisation_vote to AJAX or jQuery in order to alert the user if his vote has been done. I heard about callback but don't succeed to adapt to my case. How do that ?

