Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2007, 15:00
Avatar de rol2007
rol2007
 
Fecha de Ingreso: mayo-2007
Ubicación: Santiasco CHILE
Mensajes: 300
Antigüedad: 17 años, 9 meses
Puntos: 4
mensaje de alerta

holaaa!

tengo un problema.
tengo una lista de productos en la cual tengo un link en donde si presionan eliminar los borra de la base de datos....el tema es que necesito que cuando presione el link eliminar me aparezca una ventana que diga
ESTA SEGURO?
si / no

como puedo hacerlo?
le mando el codigo

GRACIAS!!!!



Código PHP:
<HTML>
<HEAD>
<TITLE>Mostrar PRoductos - ROL</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<LINK HREF="style.css" TYPE="text/css" REL="stylesheet">
<script language="JavaScript">
function valida()
{
flag=0;
    if (document.frmbuscar.botbuscar.value == ""){
        alert("ingrese un valor para la busqueda");
        flag=1;
        document.frmbuscar.botbuscar.focus();
        return (0);
        }
    if (flag!=1)
        frmbuscar.submit();
}
</script>
<style type="text/css">
<!--
.Estilo1 {    color: #6E6E6E;
    font-family: Tahoma;
    font-weight: bold;
}
.Estilo4 {    font-family: Tahoma;
    color: #6E6E6E;
    font-size: 12px;
    image:Fotos/fyer.gif;
}
-->
</style>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 rightmargin="0" bottommargin="0">
<center>
<TABLE WIDTH=763 BORDER=0 CELLPADDING=0 CELLSPACING=0>
    <TR>
      <TD>            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" c width="763" height="258">
        <param name="movie" value="Flash/header.swf">
        <param name="quality" value="high">
        <embed src="Flash/header.swf" quality="high" type="application/x-shockwave-flash" width="763" height="258"></embed>
      </object></TD>
    </TR>
    <TR>
      <TD>            <TABLE WIDTH=763 BORDER=0 CELLPADDING=0 CELLSPACING=0>
        <TR>
          <TD background="images/2t1.gif" WIDTH=763 HEIGHT=20 ><div style="padding-top:3px;padding-left:24px " class="head"><img src="images/img.gif" align="absmiddle">&nbsp; Mostrar productos </div></TD>
        </TR>
        <TR>
          <TD WIDTH=763 HEIGHT=415 ><div style="padding-top:15px;padding-left:30px;padding-right:25px; line-height:12px ">
         <strong> </strong>
         <p class="Estilo4">
         <?
          
include ("lib/conexion.php");
$conect=conect();
$selc=mysql_query("select * from repuestos");
echo
"<h2 align=center>Repuestos</h2> 
    <p align=center>
        <TABLE  CELLSPACING=1 CELLPADDING=1>
      <TR>
      <td><b>Codigo</b>&nbsp;</td>
      <td><B>Nombre</B></TD> 
      <TD>&nbsp;
      <B>Cantidad</B>&nbsp;</TD>
      <td><B>Valor</B></TD>
      <TD><B>Borrar</B>&nbsp;
      </TD></TR> "
;
      
      
      
       while(
$row=mysql_fetch_array($selc)) 
       {
      
printf("<tr>
      <td>%s&nbsp;</td>
          <td>&nbsp;%s</td>
        <td>%s&nbsp;</td>
      <td>&nbsp; %s&nbsp;
      
      <td><a href=\"borra.php?id=%d\">Borrar</a></td></tr>"
$row["cod_prod"],$row["nombre_producto"],$row["cantidad"],$row["valor"],$row["cod_prod"]);
   } 
            

mysql_free_result($selc);
mysql_close($conect);
?>
 </p>
         <p class="Estilo4"><form name="frmbuscar"method="POST" align= "right" action="buscarprod2.php"><strong>Palabra clave:</strong><input type="text" name="botbuscar" size="20"><br> 
<input type="button" value="Buscar" onClick="valida();" name="buscar1"> </input>
</form></p>
          </div></TD>
        </TR>
      </TABLE></TD>
    </TR>
    <TR>
        <TD background="images/1.gif" WIDTH=763 HEIGHT=35 ><div align="center" class="menu" style="padding-top:10px; "><span class="menu" style="padding-top:10px; "><a href="index.html" class="menu">Home</a> | <a href="#" class="menu">Login</a> | <a href="quienessomos.html" class="menu">Nosotros</a> |<a href="misionvision.html" class="menu"> Vision y Mision</a> |<a href="Ubicacion.html" class="menu">Ubicacion</a></span></div></TD>
    </TR>
    <TR>
        <TD  WIDTH=763 HEIGHT=47 ><div style="padding-top:15px " align="center">
          <a href="index-2.html" class="copy">AV. ERRAZURIZ 500 SANTA CRUZ. </a>        </div></TD>
    </TR>
</TABLE>
</center>
</BODY>
</HTML>