Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/05/2008, 08:21
Avatar de Carlojas
Carlojas
 
Fecha de Ingreso: junio-2007
Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 16 años, 10 meses
Puntos: 49
Respuesta: No Inserta El Campo Clave En La Bd

Que tal chari prueba así tu código: debes indicar en el formulario el metodo de envio del mismo en este caso GET y verificar que tus consultas no tengan errores ademas donde es que haces la conexión con el servidor y la BD?
adduser.php
Código PHP:
<html>
<head>
<title>Ejemplo de PHP</title>
<link href="estilo.css" rel="stylesheet" type="text/css">
</head>
<body>
<?
include_once ("../auth.php");
include_once (
"../authconfig.php");
include_once (
"../check.php");
include (
"../nivel.php");

?>
<H1 class="Estilo1">A&ntilde;adir Usuarios</H1>

<FORM ACTION="procesar.php" method = "get">
<TABLE>
<TR>
<TD>CODIGO:</TD>
<TD><INPUT NAME="CODIGO" TYPE="text" id="CODIGO" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>NOMBRE:</TD>
<TD><INPUT NAME="NOMBRE" TYPE="text" id="NOMBRE" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>CLAVE:</TD>
<TD><INPUT NAME="CLAVE" TYPE="text" id="CLAVE" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>NIVEL:</TD>
<TD><INPUT NAME="NIVEL" TYPE="text" id="NIVEL" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>DEPARTAMENTO:</TD>
<TD> <select name="DEPARTAMENTO" size="1" id="DEPARTAMENTO">
<option>ADMON</option>
<option>CALEXP</option>
<option>CIBER</option>
<option>explot</option>
<option>INF</option>
<option>ING</option>
<option>M.A.</option>
<option>SANTEC</option>
</select></TD>
</TR>

</TABLE>
<INPUT TYPE="submit" NAME="accion" VALUE="Grabar">
</FORM>
<hr>
<?php
$result 
mysql_query("select * from PERSONAL") or die( mysql_error() );
?>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR><TD>&nbsp;<B>CODIGO</B></TD> <TD>&nbsp;<B>NOMBRE</B>&nbsp;</TD><td>&nbsp;<B>CLAVE</B>&nbsp;</td><td>&nbsp;<B>NIVEL</B>&nbsp;</td><td>&nbsp;<b>DEPARTAMENTO</b></td></TR>
<?php 

while($row mysql_fetch_array($result)) {
printf("<tr><td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> <td>&nbsp;%s&nbsp;</td> <td>&nbsp;%s&nbsp;</td> <td>&nbsp;%s&nbsp;</td></tr>"$row["CODIGO"], $row["NOMBRE"], $row["CLAVE"], $row["NIVEL"], $row["DEPARTAMENTO"]);
}
mysql_free_result($result);
?>
</table>
</body>
</html>
procesar.php

Código PHP:
<?php
include_once ("../auth.php");
include_once (
"../authconfig.php");
include_once (
"../check.php");
include (
"../nivel.php");

$CODIGO=$_GET['CODIGO'];
$NOMBRE=$_GET['NOMBRE']; 
$CLAVE=$_GET['CLAVE']; 
$NIVEL=$_GET['NIVEL'];
$DEPARTAMENTO=$_GET['DEPARTAMENTO'];

$result mysql_query("insert into PERSONAL (CODIGO,NOMBRE,CLAVE,NIVEL,DEPARTAMENTO) values ('$CODIGO','$NOMBRE','$CLAVE','$NIVEL','$DEPARTAME NTO')") or die( mysql_error());
?>
Saludos.