Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/09/2012, 19:58
KAKOROSAS
 
Fecha de Ingreso: enero-2004
Mensajes: 72
Antigüedad: 20 años, 3 meses
Puntos: 1
solo ejecutar un php con sumit

amigasos tengo el siguiente codigo ...

Código PHP:
<?php 
     session_start
();
    include_once 
"conexion.php";
?> 

<?php
   
    
function verificar_testm($rut,&$result)
    {
        
$sql "SELECT * FROM testm WHERE rut = '$rut'";
        
$rec mysql_query($sql);
        
$count 0;
        while(
$row mysql_fetch_object($rec))
        {
            
$count++;
            
$result $row;
        }
        if(
$count == 1)
        {
            return 
1;
        }
        else
        {
            return 
0;
        }
    }
    
    if(isset(
$_POST['rut']))
        {
            if(
verificar_testm($_POST['rut'],$result) == 1)
            {
             echo 
'<div class="error">ya la hizo</div>';
            }
            else
            {
                
header("location:a_mf1.php");
                
            }
        }
 
        
?>
  
<?php
   
    
function verificar_testl($rut,&$result)
    {
        
$sql "SELECT * FROM testl WHERE rut = '$rut'";
        
$rec mysql_query($sql);
        
$count 0;
        while(
$row mysql_fetch_object($rec))
        {
            
$count++;
            
$result $row;
        }
        if(
$count == 1)
        {
            return 
1;
        }
        else
        {
            return 
0;
        }
    }
    
    if(isset(
$_POST['rut']))
        {
            if(
verificar_testl($_POST['rut'],$result) == 1)
            {
             echo 
'<div class="error">ya la hizo</div>';
            }
            else
            {
                
header("location:a_lf1.php");
                
            }
        }
 
        
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script type="text/JavaScript">
var procedenciaValida = new Array(
"buscar_codigo1.php","area.php"
);
var ok = false;
for(i in procedenciaValida) {
if(document.referrer.indexOf(procedenciaValida[i]) > -1) {
ok = true; 
}
}
if(!ok) {
document.location.href="buscar_codigo1.php"; 
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
  <img src="portada1.jpg" alt="" width="1100" height="200" align="top" />
  <table width="1102" border="0">
    <tr>
      <td colspan="2" align="center"><p><strong>LAS AREAS DISPONIBLES SON LAS SIGUENTES</strong></p>
      <p>&nbsp;</p></td>
    </tr>
    <tr>
      <td width="539" align="right"><p>Codigo
        
      :</p>
        <p>
      Rut:      </p></td>
      <td width="553" align="left"><p>
        <input name="codigo" type="text"  value="<?php 
$cod 
$_GET["cod"]; 
echo 
"$cod"
?>" readonly="readonly"/>        
        </p>
        <p>
          <input name="rut" type="text"  value="<?php 
$rut 
$_GET["rut"]; 
echo 
"$rut"
?>" readonly="readonly"/>
      </p></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><input name="matematicas2" type="submit" value="matematicas"/>
      <input name="lenguaje2" type="submit" value="lenguaje"/></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p><img src="divisor1.png" width="1100" height="10" alt="" /></p>
</form>
</body>
</html>
la idea es que cuando se aprete el boton matematicas ejecute el php testm y cuando se aprete el lenguaje se ejecute el php testm si se dan cuentacada php direcciona a una web diferente ..

no se como hacerlo y ustedes me han ayudado mucho y rapido .. asi que porfa cualquier ayuda se los agradesco mucho

saludos y gracias por su tiempo