Ver Mensaje Individual
  #23 (permalink)  
Antiguo 26/10/2005, 13:08
cacr
 
Fecha de Ingreso: agosto-2005
Ubicación: Mérida, Venezuela
Mensajes: 732
Antigüedad: 18 años, 8 meses
Puntos: 7
ok... un código con el que estoy probando localmente, y no funciona...

principal.php llama a una ventana emergente.
ventana1.php tiene 2 enlaces: uno para recargar el valor de la variable contador en principal.php, y otra para abrir ventana2.php
ventana2.php tiene un enlace para recargar el valor de la variable de principal.php

principal.php
Código HTML:
<?php
session_start();
if (!isset($_SESSION['contador'])) {
   $_SESSION['contador'] = 0;
} else {
   $_SESSION['contador']++;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>Página Principal</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="1">
  <tr><td>Ventana padre</td></tr>
  <tr><TD width="300" height="30" align="center"><strong><?php echo $_SESSION['contador']; ?></strong></TD></tr>
  <tr>
    <td>
      <A href="ventana1.php" name="C" target="popup" onclick='window.open("", "popup", width=350, height=150, left=350, top=300")'><strong>Abrir ventana 1</strong></A>
    </td>
  </tr>
</table>
</body>
</html> 
ventana1.php
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>Ventana 1</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table border="2">
  <tr>
    <td colspan="2" align="center" height="30">Ventana hija</td>
  </tr>
  <tr>
    <td colspan="2" height="30">
      <A href="ventana2.php" name="C" target="popup" onclick='window.open("", "popup", width=150, height=350, left=50, top=30")'><strong>Abrir ventana 2</strong></A>
    </td>
  </tr>
  <tr>
    <TD>
      <A href="" name="recargar" target="_self" onclick="window.opener.location.reload();">Recargar</A>
    </TD>
    <TD><A href="" onclick="window.close();">Cerrar</A></TD>
  </tr>
</table>
</body>
</html> 
ventana2.php
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>::Ventana 2::</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <style type="text/css">
  <!--
  body,td,th {
    color: #CCCCCC;
    background-color: green;
  }
  a:link {
    color: #FFCC33;
    text-decoration: none;
  }
  a:visited {
    text-decoration: none;
    color: white;
  }
  a:hover {
    text-decoration: underline;
  }
  a:active {
    text-decoration: none;
    color: white;
  }
  -->
  </style>
</head>
<body>
<table border="1">
  <tr>
    <td colspan="2" align="center" height="30">Ventana nieta</td>
  </tr>
  <tr>
    <td colspan="2" height="30">
      <A href="ventana2.php" name="C" target="popup" onclick='window.open("", "popup", width=150, height=350, left=50, top=30")'>Abrir ventana 2</A>
    </td>
  </tr>
  <tr>
    <TD>
      <A href="" name="recargar" target="_self" onclick="window.parent.parent.location.reload();">Recargar</A>
    </TD>
    <TD><A href="" onclick="window.close();">Cerrar</A></TD>
  </tr>
</table>
</body>
</html> 
__________________
Gracias de todas todas
-----
Linux!