Foro de programación en PHP
necesito ayuda en php ejemplo
| Autor: jorge Publicado: 17-3-2009 08:39 PM |
|
|
al hacer un formulario basico de ingreso de datos a mi base de datos en un formulario como se muestra en el codigo..siguiente <!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=iso-8859-1" /> <title>Documento sin título</title> <style type="text/css"> <!-- .Estilo1 { font-size: 16px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; } #Layer1 { position:absolute; left:61px; top:56px; width:3px; height:63px; z-index:1; } body,td,th { color: #000000; } body { background-color: #CCFF66; } .Estilo2 {font-size: 24px; font-weight: bold; font-style: italic; } .Estilo3 { font-family: Arial, Helvetica, sans-serif; font-size: 16px; } --> </style> </head> <body> <form action="grabardatos.php" method="post" name="form1" id="form1"> <p class="Estilo2"> ACTUALIZACIÓN DE DATOS</p> <p class="Estilo1">NSA <input name="nsa" type="text" id="nsa" tabindex="1" size="25" maxlength="10" /> </p> <p class="Estilo1">NOMBRE <input name="nombre" type="text" id="nombre" tabindex="2" size="50" /> </p> <p class="Estilo1"> APELLIDO PATERNO <input name="apellidop" type="text" id="apellidop" tabindex="3" size="95" /> </p> <p class="Estilo1">APELLIDO MATERNO <input name="apellidom" type="text" id="apellidom" tabindex="4" size="95" /> </p> <p class="Estilo1">DIRECCION <input name="direccion" type="text" id="direccion" tabindex="5" value="" size="95" /> </p> <p class="Estilo1">DISTRITO <input name="distrito" type="text" id="distrito" tabindex="6" size="35" maxlength="35" /> </p> <p class="Estilo1">TELEFONO <input name="telefono" type="text" id="telefono" tabindex="7" size="35" maxlength="15" /> </p> <p class="Estilo1">CELULAR <input name="celular" type="text" id="celular" tabindex="8" size="25" maxlength="15" /> </p> <p class="Estilo1">RPM <input name="rpm" type="text" id="rpm" tabindex="9" size="25" maxlength="15" /> </p> <p class="Estilo1">DNI <input name="dni" type="text" id="dni" tabindex="10" size="30" maxlength="8" /> </p> <p class="Estilo1">EMAIL <input name="email" type="text" id="email" tabindex="11" size="80" maxlength="100" /> </p> <p class="Estilo1">FECHA DE NACIMIENTO <input name="fechanac" type="text" id="fechanac" tabindex="12" size="35" maxlength="10" /> </p> <p class="Estilo1">SEXO <select name="sexo" size="1" id="sexo" tabindex="9"> <option value="M">MASCULINO</option> <option value="F">FEMENINO</option> </select> </p> <p class="Estilo1"><span class="Estilo3"> <input type="submit" name="Submit" value="Enviar" /> </form> </body> </html> este formulario llama a un archivo php <? include('conexionBD.php'); $a = $_POST['nsa']; $b = strtoupper($_POST['nombre']); $c=strtoupper($_POST['apellidop']); $d=strtoupper($_POST['apellidom']); $e=strtoupper($_POST['direccion']); $f=strtoupper($_POST['distrito']); $g=strtoupper($_POST['telefono']); $h=strtoupper($_POST['celular']); $i=strtoupper($_POST['rpm']); $j=strtoupper($_POST['dni']); $k=strtoupper($_POST['email']); $l=strtoupper($_POST['fechanac']); $m=strtoupper($_POST['sexo']); $consulta = "INSERT INTO actdatos values ('$a', '$b','$c','$d','$e','$f','$g,'$h','$i','$j','$k','$l','$m')"; if (mysql_query($consulta)) { print "<p>Registro añadido correctamente.</p>"; print "<p>Nombre: $a - Apellidos: $b</p>"; print_r ($_REQUEST); } else { print "<p>Error al añadir el registro.</p>"; } mysql_close(); ?> no me graba nada dentro de la base de datos y nose que estaria no funcionanado |
|

