I am making a web page on which I am using jQuery (more specifically this library: link ).
I have this function:
$(document).ready(function(){
var documento=prueba;
function obtener_modificacion(){
$.ajax({
type:"POST",
url:"modificaraprendiz.php",
success: function(data)
{
$('#page').html(data);
}
});
}
$(document).on("click", "#modificar", function(){
$.ajax({
type:"post",
url:"modificaraprendiz.php",
data:{doc:documento},
success: function(data){
obtener_modificacion();
}
})
});
});
It works almost everything correctly: It brings me the page I want, the variables are well defined. The problem is, when I bring the page, the error appears indefinite index (since the page I call, is a query directly).
<?php
include('conexion.php');
$doc=$_POST['doc'];
?>
That's how I get it, but it shows me the following error
Notice: Undefined index: doc on line 3.