Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2007, 13:42
THEJACKAL
 
Fecha de Ingreso: marzo-2002
Mensajes: 42
Antigüedad: 22 años, 1 mes
Puntos: 0
Script Ingresa un dato en cada refresh

Ingreso los valores, apreto enviar y me guarda bien los datos. PERO los guarda DOS veces. Uno con el valor que yo envie y otro con una "," (coma).

Cada vez que refresco el navegador guarda nuevamente los ultimos datos ingresados (aunque no aparescan en los campos).

Aqui va el codigo.

Código PHP:
<?PHP

require("conexion_mysql.inc");
require(
"inscrip2.INC");


$db conectar_base_datos();



$firstname$_REQUEST['nombre'];
$lastname=$_REQUEST['apellido'];
$birthday=$_REQUEST['fecha'];
$nation=$_REQUEST['nation'];
$info=$_REQUEST['info'];
$checked_out=$_REQUEST['checked_out'];
$checked_out_time=$_REQUEST['checked_out_time'];

$s=inscrip($nombre,$apellido,$fecha,$nation,$info,$checked_out,$checked_out_time,$db);
echo 
'INSCRIPCION OK';

?>

<html>
<head>

</head>

 
    <FORM ACTION="jugadores.php" METHOD="GET">

                      <table width="1156" border="0" cellspacing="0" cellpadding="3" align="center">

            
            

            <tr> 
                <td  width='54'>Nombre:</td>
                <td width="512">     
                <input type="text" name="nombre" size="20" maxlength="32" tabindex="9">
                </td>
            </tr>
            
            <tr> 
                <td  width='54'>Apellido:</td>
                <td width="512">     
                <input type="text" name="apellido" size="20" maxlength="32" tabindex="9">
                </td>
            </tr>

            <tr> 
                <td  width='54'>Fecha de Nacimiento: AÑO-MES-DIA</td>
                <td width="512">     
                <input type="text" name="fecha" size="20" maxlength="32" tabindex="9" value="1980-10-10">
                </td>
            </tr>    
    
            
            <tr> 
                <td  width='54'>Nacionalidad:</td>
                <td width="512"> 
                <input type="text" name="nation" size="20" maxlength="32" tabindex="9">
                </td>
            </tr>    

            <tr> 
                <td  width='54'>Equipo:</td>
                <td width="512"> 
                <input type="text" name="info" size="20" maxlength="32" tabindex="9">
                </td>
            </tr>
            
            <tr> 
                <td  width='54'></td>
                <td width="512">     
                <input type="hidden" name="checked_out" size="20" maxlength="32" tabindex="9" value="0">
                </td>
            </tr>  

            <tr> 
                <td  width='54'></td>
                <td width="512">     
                <input type="hidden" name="checked_out_time" size="20" maxlength="32" tabindex="9" value="0000-00-00 00:00:00">
                </td>
            </tr>
                        
            
        </table>
        
                      <p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        
        <INPUT TYPE="submit" VALUE="Enviar"> </p>
    </form>

</html>
Aqui el de la funcion

Código PHP:
<?php 
function inscrip($nombre,$apellido,$fecha,$nation,$info,$checked_out,$checked_out_time,$db)
{
    global 
$db;
   
echo 
mysql_error($db); 
    
  
$upd "INSERT INTO jos_joomleague_players (id,firstname,lastname,birthday,nation,info,checked_out,checked_out_time) VALUES('','$nombre','$apellido','$fecha','$nation','$info','$checked_out','$checked_out_time')";
  

  
$res mysql_query($upd,$db);
  if(!
$res)
    return(
0);
  return(
1);
    }


    

    

      
      
?>

gracias por ayudar..