I have installed PHP 4.3.1 with Apache 1.3.23.
PHP was compiled with

#./configure --with-mysql --with-apxs
#make
#make install

I have tested the file info.php and show the configuration of PHP correctly
but when i try to test a web page, not function.

The page info.php function correctly and show the php configuration.

I created a page that show a form for validate a user over MySql. This page
have two fields and one button for validate. The php code validate the user.
I used sessions. When the user click the button donīt occur anything. Why?

I intented to activate log errors but the file don't show anything.
The connection to MySQL function correctly ( test page ). And the
instruction session_start() return no errors ( test page).

The code is :

<?
include("conectar.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>CLIENTES</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../estilo/web.css" rel="stylesheet" type="text/css">
</head>

<body>
<?
if (!isset($validar)) {
?>
<form action="clientes.php" method="post" name="form" id="form">
  <table>
    <tr>
      <td width="124"><p>C&Oacute;DIGO:</p></td>
      <td width="160"><input name="miusuario" type="text" id="miusuario"
maxlength="10"></td>
    </tr>
    <tr>
      <td><p>CONTRASE&Ntilde;A: </p></td>
   <td><input name="miclave" type="password" id="miclave"
maxlength="10"></td>
   <td width="60"><input name="validar" type="submit" id="validar"
value="Validar"></td>
    </tr>
  </table>
</form>
<? }else {
        print 'else';
 $con=conectarse();
 session_start();
 if (!isset($miusuario)) {
  $miusuario = $_SESSION['cliente'];
  $miclave = $_SESSION['clave'];
 }
 $info="select * from clientes where codigo='$miusuario'";
 $cur=mysql_query($info);
 if (!$cur){
  Error_handler("Error en consulta de usuarios", $con);
 }
 $filas = mysql_num_rows($cur);
 # Comprobamos que el cursor tiene filas, si no encuentra denegamos el
acceso.
 if ($filas == 0) {
  ?>
   <table>
    <tr>
   <td><p>Acceso Denegado!</p></td>
    </tr>
  </table>
 <?
 }
 else {
 # Comprobamos que la contraseņa es la misma que la que tiene en la base de
datos.
 while($row= mysql_fetch_array($cur)) {
    $clave = $row["contrasenya"];
    $codigo = $row["codigo"];
    $razon = $row["razon"];
    }
 if ($clave == $miclave) {
  # Creo la sesion del cliente.
  session_start();
  $_SESSION['pedido'] = new pedido;
  $_SESSION['cliente'] = $codigo;
  $_SESSION['razon'] = $razon;
  $_SESSION['clave'] = $clave;
  if (!$_SESSION['pedido']){
   $_SESSION['pedido'] = new pedido;
  }
  ?>
  <p class="titulos">&nbsp;</p>
  <table>
    <tr>
   <td><p>Bienvenido Cliente: <? print "$razon" ?></p></td>
    </tr>
  </table>

<p>Para navegar por la web mientras realiza compras, rogamos no use los
controles
  de navegador, use la navegaci&oacute;n propia de la web. Gracias.</p>
  <p><a href="cfamilia.php">Cat&aacute;logo de productos por
familias</a></p>
  <!-- Hasta aqui sera el catalogo de productos -->
  <?
    }
    else{
  ?>

  <table>
    <tr>
   <td><p>Clave Incorrecta!</p></td>
    </tr>
  </table>
  <?
  }
  }
  mysql_free_result($cur);
  mysql_close($con);
}
?>
<p><a href="../index.htm">INDICE</a></p>
<p><a href="../index.htm">VOLVER</a></p>
</body>
</html>



Ejemplo


Any ideas.



-- 
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to