Ver Mensaje Individual
  #50 (permalink)  
Antiguo 27/07/2013, 09:53
santi2892009
 
Fecha de Ingreso: mayo-2012
Mensajes: 363
Antigüedad: 11 años, 11 meses
Puntos: 0
Respuesta: sitema de mensajeria duda?

index.php:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script src="ajax.js" language="javascript"></script>
<script>
setTimeout(function cargar (){
$("#destino").load("llamada.php");
},1000);
</script>
<style type="text/css">
#apDiv15 {
position: absolute;
width: 103px;
height: 88px;
z-index: 1;
left: 216px;
top: 20px;
background-color: #666666;
}
</style>
</head>

<body>
<div id="apDiv15"><div id="destino"><a href='mensajeria.php?id=band'><img src="imagen.php?refrescar" />Mensajería</a></li></div></div>
<div class=""
</body>
</html>
--------------------------
ajax:
function Buscador(){
var xmlhttp=false;
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 Buscar() {
q = document.getElementById('destino').value;
c = document.getElementById('resultados');
ajax = Buscador();
ajax.open("GET","llamada.php?q="+q);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4) {
c.innerHTML = ajax.responseText;
}
}
ajax.send(null)

}
----
llamada.php:
<?php
$host = "localhost";

$user = "root";
$passw = "";
$db = mensajeria ;
if(!@mysql_connect($host,$user,$passw)) {
print 'se produjo un error al intentar conectar';
}else{
if(!@mysql_select_db($db))
print 'no existe la base de datos';
}
$sql = "select * from mensajeria where id=$id";
$rs= mysql_query($sql);

$mensajes = mysql_num_rows($rs);
if ($mensajes != 0){
echo "<img src='sobre_abierto.GIF' />";
}else{
echo "<img src='sobre_abierto.GIF'/>";
}
?>

y no va,no da fallos pero las imagenes no se muestran.

Última edición por santi2892009; 29/07/2013 a las 12:18