Que puede ser?
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript">
function prueba() {
intervalo = setInterval('mandar()',1000);
}
</script>
</head>
<body onload="prueba()">
<script language="javascript" type="text/javascript">
function objetus() {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp
}
function mandar()
{
_objetus=objetus()
_values_send="funcion=pt"
_URL_="procesador.php?"
_objetus.open("GET",_URL_+"&"+_values_send,true);
_objetus.onreadystatechange=function() {
if (_objetus.readyState==4)
{
target="nuestrodiv_id"
document.getElementById(target).innerHTML=_objetus.responseText;
}
}
_objetus.send(null);
return
}
</script>
<input type="button" name="visual" value="Pedir" onclick="mandar();">
<!-- aqui se carga el resultado -->
<div id="nuestrodiv_id"></div>
</body>
</html>
Código:
<?php
$conn = mysql_connect('localhost','root','');
mysql_select_db('Sistema',$conn);
$rs = mysql_query('SELECT a FROM prueba');
$fila = mysql_fetch_row($rs);
if(isset($_GET['funcion']))
{
$_valor=$_GET['funcion'];
if($_valor=="pt")
{
echo $fila[0];
}
}
?>

