Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/09/2003, 03:33
karlo_
 
Fecha de Ingreso: abril-2003
Ubicación: Venezuela
Mensajes: 297
Antigüedad: 20 años, 11 meses
Puntos: 1
HTTTP VARS, duda

Se puede hacer que if($HTTP_GET_VARS) trabaje en lugar que if ($submit),
esto es que si se hace click al boton puedo enviar le formulario con los datos si no se cargue el form la primera
vez.

Se puede.

[code]

<html>
<head>
<title>Eliminación de Libros ---- Biblioteca Universidad de Costa Rica</title>
</head>
<body onLoad=setfocus()>

<p align="center">Sistema de Eliminación de Libros
<br>



<?php

//SI SE EJECUTA LA INSERCION DE LA INFORMACIÓN DEL form
if ($submit) {

// ABRE CONEXION
$link = mysql_pconnect("localhost","root","prueba");
// SELECCIONA DB
mysql_select_db("biblioteca",$link);
//EJECUTA TAREA INSERCION
$sql = "DELETE FROM libros WHERE signatura_1 = '$txt_Signatura_1' AND signatura_2 = '$txt_Signatura_2' AND signatura_3 = '$txt_Signatura_3' ";
$result = mysql_query($sql);
?>



<!-- FORMULARIO SOLICITUD POST BORRAR -->
<form method="post" name="frm_Ingreso" action="<?php echo $PHP_SELF?>">
<table border="1">
<tr>
<td>
Introduzca la Signatura del Libro
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_1"><br>
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_2"><br>
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_3"><br>
</td>
</tr>
<tr>
<td>
<input type="Submit" name="submit" value="Borrar">
</td>
</tr>
<tr>
<td>
Libro Borrado
</td>
</tr>
</table>
</form>



<?php
} else{
?>


<!--FORMULARIO SE MUESTRA LA PRIMERA VEZ CARGA PAGINA -->
<form method="post" name="frm_Ingreso" action="<?php echo $PHP_SELF?>">
<table border="1">
<tr>
<td>
Introduzca la Signatura del Libro
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_1"><br>
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_2"><br>
</td>
</tr>
<tr>
<td>
<input type="Text" name="txt_Signatura_3"><br>
</td>
<tr>
<td>
<input type="Submit" name="submit" value="Borrar">
</td>
</table>
</form>



<?php
}
// end if
?>


</body>
</html>
__________________
crecer es conocer y conocer es aprender