Me imagino que ya alguien lo ha preguntado, buscando en los mensajes del foro no he encontrado una posible respuesta/guia a mi problema, por favor les pido de su ayuda...
tengo un form donde checo si existe un id antes de cargarlo a la base
Código HTML:
<form method="post" action="gral_pre_check.php" onSubmit="return formCheck(this);"> <table width="93%" border="0" cellpadding="5"> <tr> <td valign="middle"><div align="right" class="Estilo3">ID SITIO : </div></td> <td><input name="id_sitio" type="text" id="id_sitio" size="15" maxlength="8" onkeypress="return handleEnter(this, event)"></td> </tr> <tr> <tr> <td class="Estilo8"> </td> <td><input type="submit" name="Submit" value="Checar"></td> </tr> </table> <br> </form>
Código PHP:
include("gral_conec.php");
$link=Conectarse();
$id=$_POST['id_sitio'];
$reg = mysql_query("SELECT id_sitio FROM ingmvd WHERE id_sitio='".$id."'",$link);
if (mysql_num_rows($reg) > 0){
header ("Location: $dir_go?error_login=7"); //le mando el error de que el id ya exite en la base
}else{
header ("Location: gral_form_add.php?id='$id'");}// si no existe lo mandamos a la pgina donde pueda cargar los datos
Ahora lo que necesito es que ese id que se checo y que no existe aun en la base de datos, se me cargue automaticamente en la pagina donde voy a cargar el resto de los datos
Código HTML:
<form method="post" action="gral_check.php" onSubmit="return formCheck(this);"> <table width="93%" border="0" cellpadding="5"> <tr> <td valign="middle"><div align="right" class="Estilo3">ID SITIO : </div></td> <td><input name="id_sitio" type="text" id="id_sitio" size="15" maxlength="8" onkeypress="return handleEnter(this, event)" value=" <?php echo $_GET['id'] ?>"></td> </tr> ......... </table>
pero por alguna razon no me sale!!!
me he quebrado la cabeza tratando de encontrar donde esta mi error
por favor alguien que me ayude
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)