Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/06/2009, 22:23
Avatar de alonsoandres
alonsoandres
 
Fecha de Ingreso: enero-2004
Ubicación: Matamoros, Tamaulipas
Mensajes: 305
Antigüedad: 20 años, 3 meses
Puntos: 3
Respuesta: problemas con sesiones y cookies

Prueba de esta manera.
Código PHP:
<?php
session_start
();
?>
<html>
<head>
<title>Pagina Principal</title>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: #CACACA;
    background-image: url(bg.png);
}
.Estilo1 {
    font-size: 24px;
    font-weight: bold;
}
a:link {
    color: #FF0066;
}
a:visited {
    color: #FE0066;
}
a:hover {
    color: #0066FF;
}
a:active {
    color: #0066FF;
}
.Estilo4 {font-size: 38px; font-weight: bold; }
.Estilo5 {font-size: 18px; font-weight: bold; }
.Estilo6 {font-size: 18px}
body,td,th {
    color: #000000;
}
-->
</style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

<body>
<div align="center">
  <table width="700" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td><img src="Gráfico2.png" width="249" height="98"></td>
      <td bgcolor="#FFFFFF"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" width="700" height="150" title="menu">
        <param name="movie" value="menu.swf">
        <param name="quality" value="high">
        <embed src="menu.swf" quality="high" pluginspage="" type="application/x-shockwave-flash" width="700" height="150" ></embed>
      </object></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p class="Estilo6">&nbsp;</p>
  <p class="Estilo6"><a href="contrasena.php"><img src="Gráfico2.png" width="249" height="98" border="0"></a></p>
  <p class="Estilo4">&nbsp;    </p>
  <p class="Estilo4"><span class="Estilo6">
    <?PHP
if($usuario=="admin" && $pass=="123")
{
$valido="si";
} else {
$valido="no";
}
if(
$valido=="si")
{

$_SESSION['login']='si';
echo 
'Se ha iniciado la sesion correctamente';

else 
{
    
?>
    
    <script type="text/javascript">
        location.href="contrasena.php";
        </script>
    <? 

?>
    </span></p>
  <p class="Estilo6">&nbsp;</p>
  <p class="Estilo6">&nbsp;</p>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="ladrillo.png">&nbsp;</td>
  </tr>
</table>
</body>
</html>