I have a javascript function in which I get a variable that I need to use in a different php file and I do not know how to do it. I show you the code of the files, thanks in advance.
JavaScript file (test1.html)
function boton() {
var id_nombre=document.formConductor.selector.value;
$.post("prueba2.php", [id_nombre]);
alert (id_nombre);
}
PHP file (test2.php)
$conductor = $_POST["id_nombre"];
print $conductor;