amigos tengo un dos incoveniente al momento de insertar y necesito de su ayuda es para lo siguiente la primera es que cuando inserto no me inserta lo de los combos y por ultimo en este codigo quisiera que me muestre un mensaje diciendo si deseo guardar realmente el registro de esos datos:
formulario
<form action="guardar_datos.php" method="post" name="cargar" id="cargar">
<table width="509" border="1" align="center" cellpadding="2" cellspacing="2">
<!--DWLayoutTable-->
<tr>
<td width="167" height="28" valign="top"><span class="Estilo1">Sai:</span></td>
<td colspan="2" valign="top"><input name="Sai" type="text" id="Sai" size="10" /></td>
</tr>
<tr>
<td height="28" valign="top"><span class="Estilo1">Carnet de Identidad : </span></td>
<td colspan="2" valign="top"><input name="Cirun" type="text" id="Cirun" size="12" /></td>
<tr>
<td><span class="Estilo1">Lugar Carnet : </span></td>
<td>
<select name="ciudadid" id="ciudadid">
<?php
$link=Conectarse();
$sql = "select ciudadid, ciudad from ciudad order by ciudad";
$result = mysql_query($sql, $link);
if ($row = mysql_fetch_array($result)){
mysql_field_seek($result,0);
while ($field = mysql_fetch_field($result)){
} do {
echo "<option value=". $row[0]. ">". $row[1]. "</option>";
} while ($row = mysql_fetch_array($result));
} else {
echo "No se encontraron resultados!";
}
?>
</select>
<tr>
<td height="28" valign="top"><span class="Estilo1">Apellidos:</span></td>
<td colspan="2" valign="top"><input name="Apellidos" type="text" id="Apellidos" size="25" /></td>
<tr>
<td height="28" valign="top"><span class="Estilo1">Nombres:</span></td>
<td colspan="2" valign="top"><input name="Nombres" type="text" id="Nombres" size="25" /></td>
</tr>
<tr>
<td><span class="Estilo1">Area : </span></td>
<td>
<select name="area" id="area">
<?php
$link=Conectarse();
$sql = "select areaid, nombre from area order by nombre";
$result = mysql_query($sql, $link);
if ($row = mysql_fetch_array($result)){
mysql_field_seek($result,0);
while ($field = mysql_fetch_field($result)){
} do {
echo "<option value=". $row[0]. ">". $row[1]. "</option>";
} while ($row = mysql_fetch_array($result));
} else {
echo "No se encontraron resultados!";
}
?>
</select>
<tr>
<td><span class="Estilo1">Cargo : </span></td>
<td>
<select name="cargoid" id="cargoid">
<?php
$link=Conectarse();
$sql = "select cargoid, nombre from cargo order by nombre";
$result = mysql_query($sql, $link);
if ($row = mysql_fetch_array($result)){
mysql_field_seek($result,0);
while ($field = mysql_fetch_field($result)){
} do {
echo "<option value=". $row[0]. ">". $row[1]. "</option>";
} while ($row = mysql_fetch_array($result));
} else {
echo "No se encontraron resultados!";
}
?>
</select>
guardar_datos.php
<?php
include("conexion.php");
?>
<?php
$Sai= $_POST["Sai"];
$Cirun= $_POST["Cirun"];
$Dptocirun= $_POST["Dptocirun"];
$Apellidos= $_POST["Apellidos"];
$Nombres= $_POST["Nombres"];
$Area= $_POST["Area"];
$Cargo= $_POST["Cargo"];
$link=Conectarse();
$sql = "INSERT INTO empleados (Sai, Cirun, Dptocirun, Apellidos, Nombres, Area, Cargo)";
$sql .= "VALUES ('$Sai', '$Cirun', '$Dptocirun', '$Apellidos', '$Nombres', '$Area', '$Cargo')";
$result = mysql_query($sql) or die(mysql_error());
echo "<h1><h2>Registro Añadido...</h2></h1>";
?>