First of all, I have already looked at several other posts about the subject here and I did not find what I need, my scenario is the following I am generating several EX links:
challenge.php? id = 2 & name = joao
challenge.php? id-3% name = jose
And I need to pass this via ajax to my php page which processes this. But the page is not picking up the data, what can it be? follow my code
urls generated by <a id='desafiar' href='desafiar.php?idd={$linha['id']}&d={$linha['username']}'></a>
script
$(document).ready(function() {
$("#desafiar").click(function( e ) {
e.preventDefault();
var url = $( this ).attr('href');
$.ajax({
cache: false,
type: "POST",
url: "desafio.php",
data: {url},
success: function( data ){
$("#resultado").html( data );
}
});
});
});
on the page that takes php
$iddesafiante = $_SESSION['user_id'];
$desafiante = $_SESSION['username'];
$iddesafiado = $_GET['idd'];
$desafiado = $_GET['d'];
open to suggestions