Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/11/2008, 05:54
dannysoft
 
Fecha de Ingreso: julio-2008
Mensajes: 39
Antigüedad: 15 años, 9 meses
Puntos: 1
Pregunta ayuda con php

saludos foro tengo un problema he diseñado una pagina que muestra una informacion si introduces bien unos campos (cod_pro) y (contra), mi problema es este, quisiera que si se introducen ciertos numeros (26 por ejemplo) en el campo cod_pro me redireccione a una pagina x, y me muestre una info que esta en mi bd, el codigo que yo utilizo para mostra mi info es esta:

v_consulta.php
Código PHP:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>:: Venser S.A.C. :::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="estilo.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="top" bgcolor="#FFFFFF"> 
    <td colspan="3"><font color="#FFFFFF"> 
      <?php include("superior.htm")?>
      </font></td>
  </tr>
  <tr valign="top" bgcolor="#FFFFFF"> 
    <td width="160"> <font color="#FFFFFF"> 
      <?php include("izquierda.htm")?>
      </font></td>
    <td width="440"><font color="#FFFFFF">&nbsp;
    
    <table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="420">
      <!-- fwtable fwsrc="titulo.png" fwbase="titulo.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
      <tr>
        <td><img src="images/spacer.gif" width="115" height="1" border="0" alt="" /></td>
        <td><img src="images/spacer.gif" width="305" height="1" border="0" alt="" /></td>
        <td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
      </tr>
      <tr>
        <td rowspan="3"><img src="images/titulo_r1_c1.jpg" alt="" name="titulo_r1_c1" width="115" height="30" border="0" id="titulo_r1_c1" /></td>
        <td><img src="images/titulo_r1_c2.jpg" alt="" name="titulo_r1_c2" width="305" height="2" border="0" id="titulo_r1_c2" /></td>
        <td><img src="images/spacer.gif" width="1" height="2" border="0" alt="" /></td>
      </tr>
      <tr>
        <td background="images/titulo_r2_c2.jpg" class="titulo">Preliquidaciones</td>
        <td><img src="images/spacer.gif" width="1" height="25" border="0" alt="" /></td>
      </tr>
      <tr>
        <td><img src="images/titulo_r3_c2.jpg" alt="" name="titulo_r3_c2" width="305" height="3" border="0" id="titulo_r3_c2" /></td>
        <td><img src="images/spacer.gif" width="1" height="3" border="0" alt="" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center" valign="middle" class="texto">RESULTADO DE LA CONSULTA</td>
  </tr>
  
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><?php 
      
require_once("autenticar_usr_fns.php");
 
$postor=$_POST[cod_postor];//
 
$contra=$_POST[contra];//'101'; //
 
$consulta_array=busca_empresa($postor,$contra);


?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="texto_nota">
  <tr>
    <td align="center" valign="middle" class="rojo">EL SALDO QUE FIGURA DEBERA DEPOSITARLO EN LA CTA/CTE ME</td>
  </tr>
    <tr>
    <td align="center" valign="middle" class="rojo">DEL BANCO DE CREDITO DEL PERU Nº 193-1194690-1-84</td>
  </tr>
    <tr>
    <td align="center" valign="middle" class="rojo">DE "LOS ANDES SERVICIOS CORPORATIVOS SAC"</td>
  </tr>
</table> 
  <table class="alt1" width="100%" cellpadding=4 border=0 cellspacing=1>
<?php
    
  
if (!is_array($consulta_array)){
     echo 
'No Se Puede mostrar ningun dato(s) para esta Empresa o el código y contraseña no es correcto.<br>';
       }
  else{
  
$color "#dfebf8"
  
$alinea="center";
  
$alinea1="left";
  
$enca="class=thead";
  
  echo 
"<tr $enca> <td><strong>Nº</strong></td>";
  echo 
"<td align=$alinea><strong>Postor</strong></td>";
  echo 
"<td align=$alinea><strong>Lote</strong></td>";
  echo 
"<td align=$alinea><strong>Base N°</strong></td>";
  echo 
"<td align=$alinea><strong>SALDO A CANCELAR US$</strong></td>";
  echo 
"</tr>";
      
      
$aa=1;
    
$datofi=0;
      foreach (
$consulta_array as $cu)
        {
         foreach (
$cu as $dato)
           if (
$color == '#dfebf8')
            
$color '#f5f5f5';
            
          else
          
$color '#dfebf8';
          
          echo 
"<tr bgcolor='$color'>";
          echo 
"<td align='$alinea'>".$aa."\n</td>";
          echo 
"<td align='$alinea'>".$cu[codigo]."\n</td>";
          echo 
"<td align='$alinea'>".$cu[lote]."</td>";
          echo 
"<td align='$alinea'>".$cu[codigo]."\n</td>";
            echo 
"<td align='$alinea'>".$cu[saldo]."\n</td>";
            echo 
"</tr>";
           
$aa++;
           
$datofi=$datofi+$cu[saldo];
        }
        
  }
   
?>
  <tr class="alt5">
    <td colspan="4" align="center">Saldo Total $ </td>
    <td align="center"> <?php echo $datofi?> </td>
  </tr>
</table>

</td>
    </tr>
  <tr>
    <td><a href="v_preliquidaciones.php">Regresar a consultar nuevamente</a></td>
    
  </tr>
</table>
      </td>
    <td width="160"> <font color="#FFFFFF"> 
    
    
      <?php include("derecha.htm")?>
      </font></td>
  </tr>
  <tr valign="top" bgcolor="#FFFFFF"> 
    <td colspan="3"><font color="#FFFFFF">&nbsp;
      <?php include("base.htm")?>
      </font></td>
  </tr>
</table>
</body>
</html>
mi codigo para autentificar

autenticar_usr_fns.php
Código PHP:
<?php
// 
require_once("conectardb_fns.php");

function 
busca_empresa($postor$contra)
{
if (!
$postor==' ')
      return 
false;
  
  
$conn db_connect();
  if (!
$conn)
    return 
false;
  
  
$query "select * from postores where codigo='$postor' and contra='$contra'";
  
      
$result = @mysql_query($query);
      if (!
$result)
     return 
false;
    
$num_proyectos = @mysql_num_rows($result);
     if (
$num_proyectos==0)
         return 
false;
         
$result db_resultados_array($result);
       return 
$result;
}

function 
db_resultados_array($resultado)
{
     
$res_array = array();
    for (
$count=0$row = @mysql_fetch_array($resultado); $count++)
    
$res_array[$count] = $row;
    return 
$res_array;
}


?>
mi problema es como puedo hacer eso ?, gracias por la ayuda que me den...