De esta manera borro el id:
Button:
Código:
<INPUT Type=Submit class="formu"onClick="this.form.action='3.php?borrar=<? echo $row[0];?>';" Value="Eliminar">
3.php:
Código:
Pongo como ejemplo un sublink: http://www.miwebsite.com.ar/index.php?id=impresoras <script> var pagina="main.php"; function redireccionar() { location.href=pagina; } setTimeout ("redireccionar()", 1000); </script> <style type="text/css"> <!-- body { background-image: url(img/fondo.gif); } --> </style> <link href="stile_form.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .Estilo9 {color: #0099FF} --> </style> <link href="estilos.css" rel="stylesheet" type="text/css"> <p> </p> <p> </p> <p> </p> <table width="160" height="47" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#1C203D"> <tr> <td width="154" align="center" valign="middle" class="style1"><? echo "Eliminando Producto $id"; ?></td> </tr> </table> <?php $myconn = mysql_connect("localhost","root","----"); mysql_select_db("----"); if(isset($_GET['borrar'])) { // Variable borrar mysql_query("DELETE FROM productos WHERE id='".$_GET['borrar']."'"); } else ?>
Gracias de antemano.