Código PHP:
<form action="Guarda_Empleados.php" method="post" enctype="multipart/form-data" name="f">
<p class="Estilo5"><b>Administrador de RHH SIAP </b></p>
<fieldset>
<legend>ingreso Trabajadores </legend>
<label for="firstname" accesskey="f">Rut: </label>
<input type="text" id="Rut" name="Rut" tabindex="1" value="" title="nombre">
<br>
<label for="lastname" accesskey="l">Nombres: </label>
<input type="text" id="Nombre" name="Nombre" tabindex="2" title="email">
<br>
<label for="email" accesskey="e">Apellidos: </label>
<input type="text" id="Apellido" name="Apellido" tabindex="3" title="titulo">
<br>
<label for="label" accesskey="e">Fecha Nacimiento </label>
<input type="text" id="FechaNacimineto" name="FechaNacimineto" tabindex="3" title="titulo">
<br>
<label for="label" accesskey="e">Estado Civil </label>
<label>
<?
include ("../jao/conexion.php");
//query para el combo
$query_afp=mysql_query ("SELECT id_Estadocivil , Nombre FROM tblestadocivil ");
echo '<select name="id_Estadocivil ">';
echo '<option value=""> Seleccione </option>';
//Por cada registro encontrado en la tabla me genera un <option>
while ($row = mysql_fetch_array($query_afp))
{
$Nombre= $row["Nombre"];
$id_Estadocivil =$row["id_Estadocivil "];
echo "<option value='$id_Estadocivil '>$Nombre</option>";
}
echo "</select></p>";
?>
</label>
<br>
<label for="label" accesskey="e">Fecha Ingreso </label>
<input type="text" id="Fecha_Ingreso" name="Fecha_Ingreso" tabindex="3" title="titulo">
<br>
<label for="label" accesskey="e">Activo </label>
<input type="text" id="Activo" name="Activo" tabindex="3" title="titulo">
<br><label for="label" accesskey="e">Fecha Termino </label>
<p>
<input type="text" id="fechaTermino" name="fechaTermino" tabindex="3" title="titulo">
</p>
<p><br>
</p>
<label for="imagen" accesskey="i"></label>
<small>. </small><br>
<input name="submit" type="submit" class="required" id="submit" tabindex="5" value="Grabar ">
<input name="Submit" type="reset" class="required" value="Restablecer">
<label></label>
<label for="kludge"></label>
</fieldset>
<fieldset>
<legend>Alerta Noticias</legend>
<small>Recuerda completar todos los campos SIAP .SA </small>
</fieldset>
</form>
<title></title>
</body>
</html>
Código PHP:
<?
# datos que hay que modificar según la base de datos
$host="localhost";
$user="root";
$pass="";
$db=mysql_connect($host,$user,$pass) or die ("Error durante la conexión a la base de datos");
$sql="INSERT INTO tblEmpleados (Rut,Nombre,Apellido,FechaNaciemiento,Id_Estado,FechaIngreso,Activo,FechaTermino) VALUES('".$Rut."','".$Nombre."','".$Apellido.",'".$FechaNacimiento.",'".$Id_Estado.",'".$FechaIngreso.",'".Activo.'",'".$FechaTermino.")";
mysql_db_query("db_anuncios",$sql,$db);
mysql_close();
?