¿Cómo hacer encabezado o pie de permanecer estático? No Iframes please!

  • inlineskater
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 17, 2010
  • Mensajes: 6
  • Status: Offline

Nota Septiembre 17th, 2010, 10:16 am

Tengo el siguiente:

header.php
footer.php
index.php

about.php
gallery.php
contact.php

Quiero integrar un clip de audio en vivo en el "header.php footer.php o - lo que significa que quieren que el about.php, gallery.php y contact.php para abrir en el index.php es cuando elegido (en el centro de la cabecera . php y footer.php) y yo quiero perder la secuencia. Entonces, ¿cómo puedo hacer que uno de los dos permanece estático?


Ayuda
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Septiembre 17th, 2010, 10:16 am

  • Bogey
  • Bogey
  • Genius
  • Avatar de Usuario
  • Registrado: Jul 14, 2005
  • Mensajes: 8212
  • Loc: USA
  • Status: Offline

Nota Septiembre 17th, 2010, 8:55 pm

¿Ha revisado este tutorial ?
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • hgun77
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Jun 29, 2005
  • Mensajes: 164
  • Loc: Malaysia
  • Status: Offline

Nota Septiembre 17th, 2010, 9:09 pm

PHP Código: [ Select ]
<?php
 include('header.php');
 include('index.php');
 include('footer.php');
?>
 
<?php
 include('header.php');
 include('about.php');
 include('footer.php');
?>
 
  1. <?php
  2.  include('header.php');
  3.  include('index.php');
  4.  include('footer.php');
  5. ?>
  6.  
  7. <?php
  8.  include('header.php');
  9.  include('about.php');
  10.  include('footer.php');
  11. ?>
  12.  


Lo siento, no sé si esto ayuda.
Malaysia > KL > TAR College
  • righteous_trespasser
  • Scuffle
  • Genius
  • Avatar de Usuario
  • Registrado: Mar 12, 2007
  • Mensajes: 6228
  • Loc: South-Africa
  • Status: Offline

Nota Septiembre 21st, 2010, 2:10 am

Dos soluciones vienen a la mente... iFrames y AJAX .

Yo sugeriría ajax aunque...Aquí es cómo conseguir lo que necesita en ajax (usando jQuery ):

Código: [ Select ]
<html>
<head>
 <title>AJAX Test</title>
 <script type="text/javascript" src="/javascript/jquery.js"></script>
<script type="text/javascript">
  $(document).ready(function(){
   $('.link').click(function(){
    var id = $(this).attr('id');
    $.ajax({
     type:'post',
     url:id + '.php',
     data:'',
     success:function(returnText){
      $('#body').html(returnText);
     },
     error:function(){
      alert('There was an error while changing the page, please try again.');
     }
    });
   });
  });
</script>
</head>
<body>
 <?php include('header.php'); ?>
 <div id="body">
 </div>
 <?php include('footer.php'); ?>
</body>
</html>
  1. <html>
  2. <head>
  3.  <title>AJAX Test</title>
  4.  <script type="text/javascript" src="/javascript/jquery.js"></script>
  5. <script type="text/javascript">
  6.   $(document).ready(function(){
  7.    $('.link').click(function(){
  8.     var id = $(this).attr('id');
  9.     $.ajax({
  10.      type:'post',
  11.      url:id + '.php',
  12.      data:'',
  13.      success:function(returnText){
  14.       $('#body').html(returnText);
  15.      },
  16.      error:function(){
  17.       alert('There was an error while changing the page, please try again.');
  18.      }
  19.     });
  20.    });
  21.   });
  22. </script>
  23. </head>
  24. <body>
  25.  <?php include('header.php'); ?>
  26.  <div id="body">
  27.  </div>
  28.  <?php include('footer.php'); ?>
  29. </body>
  30. </html>


en header.php usted debe tener algo como sigue:

Código: [ Select ]
<div id="menu">
<a class="link" id="gallery">Gallery</a>
<a class="link" id="about">About</a>
</div>
  1. <div id="menu">
  2. <a class="link" id="gallery">Gallery</a>
  3. <a class="link" id="about">About</a>
  4. </div>
Let's leave all our *plum* where it is and go live in the jungle ...
  • inlineskater
  • Newbie
  • Newbie
  • No Avatar
  • Registrado: Sep 17, 2010
  • Mensajes: 6
  • Status: Offline

Nota Septiembre 22nd, 2010, 11:57 am

Necesito ayuda.

¿Dónde está el archivo jquery.js? Creo que es por eso que su trabajo no...Además ¿Dónde puedo hacer el Iframes?
  • righteous_trespasser
  • Scuffle
  • Genius
  • Avatar de Usuario
  • Registrado: Mar 12, 2007
  • Mensajes: 6228
  • Loc: South-Africa
  • Status: Offline

Nota Septiembre 22nd, 2010, 11:33 pm

No hay necesidad de iFrames...Esta solución que dio fue con el Ajax...

Sólo tienes que descargar jQuery...desde el enlace en mi post anterior...
Let's leave all our *plum* where it is and go live in the jungle ...

Publicar Información

  • Total de mensajes en este tema: 6 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 149 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC