aqui esta el ajax, por ejemplo ponerlo dentro de un textfield.
Código PHP:
Ver original
<html>
<head>
<script type="text/javascript" src="../plugins/jquery-1.7.2.js" ></script>
</head>
<body>
<br>
<label>Nombre de Usuario:</label>
<input type="text" id="texto" />
<input type= "button" value = "Consultar" id = "boton" />
<br></br>
<br></br>
<br></br>
<label>DATOS USUARIO</label>
<div id = "datos_usu" >
<br></br>
<br></br>
<br></br>
</div>
<label>PERMISOS QUE POSEE</label>
<div id ="permiso">
<br></br>
</div>
<script>
$(document).ready(function(e) {
$('#boton').click(function(){
var mensaje = $('#texto').val();
$.ajax({
type : "GET",
url : "admin_urgencia/ajax_admin_urg_add.php",
data : "mensaje="+mensaje,
cache : false,
success : function(datos){
alert(mensaje);
if (mensaje.length !== 0) {
var hola = $_GET['nombres'] ;
alert(hola);
}
else{
alert("Necesita llenar el campo Nombre de usuario");
}
}
});
});
});
</script>
</body>
</html>
y aqui esta el php q necesito mandarle las variables
Código PHP:
Ver original
<?php
$hola = $_GET['mensaje'];
$bus = $usu_urg -> buscar($hola);
$bus2 = $dato_usu -> setUsuario($bus['out_usu_id']);
$id = $dato_usu -> getFunID();
$bus3 = $funcio -> setFuncionario($id);
$nombres = $funcio -> getNombres();
?>
por ejemplo la variable nombres necesito rescatarla y enviarla al html
 
 



