Foros del Web » Programando para Internet » Javascript » Frameworks JS »

php ajax

Estas en el tema de php ajax en el foro de Frameworks JS en Foros del Web. Hola amigos. Hace tiempo que no hago algo en php, y ahora necesito hacer algo con php y ajax. Necesito que me orienten al respecto. ...
  #1 (permalink)  
Antiguo 25/03/2009, 13:05
 
Fecha de Ingreso: octubre-2004
Ubicación: Santiago de Chile
Mensajes: 504
Antigüedad: 19 años, 6 meses
Puntos: 0
De acuerdo php ajax

Hola amigos. Hace tiempo que no hago algo en php, y ahora necesito hacer algo con php y ajax. Necesito que me orienten al respecto.
Muchisimas Gracias.
__________________
Dios es mas grande que tu problema :-)
  #2 (permalink)  
Antiguo 25/03/2009, 13:35
 
Fecha de Ingreso: enero-2008
Mensajes: 163
Antigüedad: 16 años, 3 meses
Puntos: 2
Respuesta: php ajax

pues ai te va un ejemplo no es tanto php pero pues de ajax tu pon las imagenes que quieras jeje solo que utilizo protocoulous pero espero que le entiendas jejejeje

Código PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
title>Untitled Document</title>
<
link href="stilo.css" rel="stylesheet" type="text/css">
<
script type="text/javascript" src="scripts/protoculous.js"></script>
<script type="text/javascript">
document.observe("dom:loaded", inicialisar);
function inicialisar(){
    $("contenedor").hide();
}
function abrir(nombre){
        var url="pagina.php?nombre="+nombre;
        var ajax = nuevoAjax();
        ajax.open("GET",url,true);
        ajax.onreadystatechange=function(){
        if(ajax.readyState==1){
        }
        if(ajax.readyState==4){
            $("info").innerHTML = ajax.responseText;            
            $("contenedor").show();
            new Effect.BlindDown("info");
        }
    }
    ajax.send(null);
}
function nuevoAjax()
{     
    var xmlhttp=false;
    try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){
        try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
        catch(E){
            if (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();
        }
    }
    return xmlhttp; 
}
function fotos(nombre){
    $('fotoprincipal').src=nombre;
    new Effect.BlindDown('divfoto');    
}
function cerrar(){
    $('contenedor').hide();
}
function delay(){
    setTimeout('afterFiveSeconds()',5000)
}
function afterFiveSeconds(){
    alert("after 5 seconds");
}
</script>
</head>

<body>
<div id="contenedor">
    <div id="hideshow">
        <div id="fade"></div>
        <div class="popup_block" id="info">
        
        </div>
    </div>
</div>
<p>&nbsp;</p>
<table width="400" border="0" align="center" cellpadding="5" class="borde">
  <tr>
    <td><div align="center" class="bordefoto"><a href="javascript:abrir('13330irt355nsimg600x450106766054318_7_.jpg')"><img src="13330irt355nsimg600x450106766054318_7_.jpg" width="100" height="100" border="0"></a></div></td>
    <td><div align="center" class="bordefoto"><a href="javascript:abrir('Carros4.jpg')"><img src="Carros4.jpg" width="100" height="100" border="0"></a></div></td>
    <td><div align="center" class="bordefoto"><a href="javascript:abrir('SmileWallpapers.jpg')"><img src="SmileWallpapers.jpg" width="100" height="100" border="0"></a></div></td>
  </tr>
</table>
<div align="left"><a href="javascript:delay()">Esto es un link</a></div>
</body>
</html> 
pagina.php
Código PHP:
<?php 
$nombre
=$_GET['nombre'];
?>
<table width="600" border="0" class="bordeblanco" bgcolor="#000000">
  <tr>
      <td colspan="3"><div align="right"><a href="javascript:cerrar()"><img src="cross.png" border="0"></a></div></td>
  </tr>
  <tr>
    <td width="70%" rowspan="2" valign="top"><div align="center" id="divfoto"><img src="<?php echo $nombre;?>" id="fotoprincipal" width="450" height="300"></div></td>
    <td valign="top" class="td"><a href="javascript:fotos('<?php echo $nombre;?>')"><img src="<?php echo $nombre;?>" width="100" height="100" border="0"></a></td>
    <td valign="top" class="td"><a href="javascript:fotos('Carros4.jpg')"><img src="Carros4.jpg" width="100" height="100" border="0"></a></td>
  </tr>
  <tr>
    <td colspan="2" valign="top" class="blanco">HTML<br>
What I have below is a div that contains the transparent black background, and the popup on top of it. I basically have two layers on top of my content to achieve this effect.

</td>
  </tr>
</table>
  #3 (permalink)  
Antiguo 26/03/2009, 11:17
 
Fecha de Ingreso: enero-2009
Mensajes: 455
Antigüedad: 15 años, 3 meses
Puntos: 11
Respuesta: php ajax

Cita:
Hola amigos. Hace tiempo que no hago algo en php, y ahora necesito hacer algo con php y ajax. Necesito que me orienten al respecto.
Muchisimas Gracias.
no entiendo, y tu pregunta es???
  #4 (permalink)  
Antiguo 26/03/2009, 12:04
Avatar de aliza  
Fecha de Ingreso: diciembre-2008
Mensajes: 156
Antigüedad: 15 años, 4 meses
Puntos: 6
Respuesta: php ajax

Está claro, quiere algo de código para ir viendo ejemplos....
__________________
Dando cabezados se aprende...
  #5 (permalink)  
Antiguo 27/03/2009, 23:50
 
Fecha de Ingreso: enero-2009
Mensajes: 455
Antigüedad: 15 años, 3 meses
Puntos: 11
Respuesta: php ajax

Cita:
Está claro, quiere algo de código para ir viendo ejemplos....
ahh no habia entendido

pues por el momento no se que ejemplo pornerte, te recomendaria que nos dijeras que quieres hacer con php y ajax y quiza aqui te puedan recomendar la mejor manera de lo que quieras hacer, ahora si no tienes algo en especifico, pues empieza por lo mas simple, que es ajax? y empezar hacer un ejemplo muy sencillo con php, javascript y ajax

te recomiendo jquery o prototype

saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:05.