Código:
<?php if (!isset($_POST['Carga'])) { echo '<div align="center">'; echo ' <form action="sin.php" method="post">'; echo 'Expediente'; echo '<input class="col_1" onkeypress="return handleEnter(this, event)" name="caract" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="num" type="text">'; echo '/ <input class="col_1" onkeypress="return handleEnter(this, event)" name="anio" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="alc" type="text">'; echo '<input class="small green" name="Carga" value="Carga" type="submit">'; echo '</form>'; echo '</div>'; } else { if (empty($_POST['caract']) || empty($_POST['num']) || empty($_POST['anio'])) { echo '<div align="center">'; //echo "<div class='col_4'>"; echo "<div class='notice warning'><span class='icon medium' data-icon='!'></span>Faltan datos por ingresar<a href='#close' class='icon close' data-icon='x'></a></div>"; //echo "</div>"; echo ' <form action="sin.php" method="post">'; echo 'Expediente'; echo '<input class="col_1" onkeypress="return handleEnter(this, event)" name="caract" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="num" type="text">'; echo '/ <input class="col_1" onkeypress="return handleEnter(this, event)" name="anio" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="alc" type="text">'; echo '<input class="small green" name="Carga" value="Carga1" type="submit">'; echo '</form>'; echo '</div>'; } else { if(isset($_POST['caract'])) { $caract=$_POST['caract']; } if(isset($_POST['num'])) { $num=$_POST['num']; } if (isset($_POST['anio'])) { $anio=$_POST['anio']; } if (isset($_POST['alc'])) { $alc=$_POST['alc']; } $f=$caract.$num.$anio.$alc; settype($f,"string"); //conexion a la base de datos include_once('cone.php'); Conectate(); //conexion a la base de datos $busqueda=mysql_query("select expediente from pasajes") or die(mysql_error()); $encuentre=0; while ($array = mysql_fetch_array($busqueda) or $encuentre==0) { if($array['expediente']==$f) { echo '<div class="notice error"><span class="icon medium" data-icon="X"></span>EL EXPEDIENTE YA ESTA CARGADO<a href="#close" class="icon close" data-icon="x"></a></div>'; $encuentre=1; echo '<div align="center">'; echo ' <form action="sin.php" method="post">'; echo 'Expediente'; echo '<input class="col_1" onkeypress="return handleEnter(this, event)" name="caract" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="num" type="text">'; echo '/ <input class="col_1" onkeypress="return handleEnter(this, event)" name="anio" type="text">'; echo '-<input class="col_1" onkeypress="return handleEnter(this, event)" name="alc" type="text">'; echo '<input class="small green" name="Carga" value="Carga" type="submit">'; echo '</form>'; echo '</div>'; } } if ( $encuentre==0) { mysql_query("insert into pasajes(expediente) values ($f)") or die (mysql_error()); echo '<div class="notice success" align="center"><span class="icon medium" data-icon="C"></span>GUARDADO CON EXITO<a href="#close" class="icon close" data-icon="x"></a></div>'; echo '<div align="center">'; echo "<input class='col_1' value='$caract' name='caract' type='text' disabled='disabled'>"; echo "-<input class='col_1' value='$num' name='num' type='text' disabled='disabled'>"; echo "/ <input class='col_1' value='$anio' name='anio' type='text' disabled='disabled'>"; echo "-<input class='col_1' value='$alc' name='alc' type='text' disabled='disabled'>"; echo '</div">'; } } } ?>