Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/09/2008, 14:35
gabymar
 
Fecha de Ingreso: agosto-2008
Mensajes: 94
Antigüedad: 15 años, 8 meses
Puntos: 0
eliminacion con php

hola tengo un problema quiero eliminar registros de una base de datos.... hice el formulario, y me muestra los registros pero al darle click a borrar no pasa nada... aqui coloco los dos archivos...porfa cualquiera que me puediera ayudar se lo agradeceria...

----------------------------------------
ejemplo_de_borrar.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: Georgia;
font-size: large;
font-style: italic;
font-weight: bold;
color: #000066;
}
.style2 {
font-family: Georgia;
font-size: medium;
color: #000066;
font-style: italic;
font-weight: bold;
}
-->
</style>
</head>

<body>
<H1 align="left" class="style1">
<label>
<input type="image" name="imageField" id="imageField" src="logocantv.jpg" />
</label>
</H1>
<H1 align="left" class="style1">
<label>
<input type="image" name="imageField2" id="imageField2" src="cabecera_gobenlinea.gif" />
</label>
</H1>
<H1 align="center" class="style1">&nbsp;</H1>
<marquee bgcolor="#FFFFFF" width="100%" scrolldelay="100" scrollamount="4" loop="infinite">
<div align="center" class="style4 style5"><h2 align="left" class="style12">
<h2 align="center" class="style9 style1">BIENVENIDO AL SISTEMA DE GESTION DE SERVICIOS OCASIONALES (GESEO)</h2>
<p align="center" class="style9">&nbsp;</p>
</div>
</marquee>
<H1 align="center" class="style1">&nbsp;</H1>
<H1 align="center" class="style1">ELIMINACION DE SERVICIOS</H1>
<H1 align="center" class="style1">&nbsp;</H1>
<form name="orden" method="get" action="borrar.php" onSubmit="return check_campos(this)">

<?php
include("funciones.php");
$link=con_db();
$result=mysql_query("select * from servicio_voz");

?>

<TABLE width="820" height="21" BORDER=1 CELLPADDING=0 CELLSPACING=0 bordercolor="#000066">
<TD width="159"> <div align="center"><B>N° DE SOLICITUD</B> </div></TD>
<TD width="159"> <div align="center"><B>RIF CLIENTE</B> </div></TD>
<TD width="231"> <div align="center"><B>NOMBRE DEL EVENTO</B> </div></TD>
<TD width="197"> <div align="center"><B>FECHA DE CREACION</B> </div></TD>
<TD width="58"> <div align="center"><B>BORRAR</B> </div></TD>
</TR>
<?php

while($row = mysql_fetch_array($result)) {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><a href=\"borra.php?cod_servi=%d\">Borra</a></td></tr>", $row["cod_ser"],$row["cod_cli"],$row["nom_eve"],$row["fec_crea"], $row["cod_ser"]);
}
mysql_free_result($result);
descon_db();
?>


<?php

$result=mysql_query("select * from servicio_datos");

?>
<?php

while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s</td><td>%s</td><td>%s</td><td>%s</td><td><a href=\"borra.php?cod_servi=%d\">Borra</a></td></tr>", $row["cod_ser"],$row["cod_cli"],$row["nom_eve"],$row["fec_crea"], $row["cod_ser"]);
}
mysql_free_result($result);
descon_db();
?>



<?php

$result=mysql_query("select * from servicio_video");

?>
<?php

while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s</td><td>%s</td><td>%s</td><td>%s</td><td><a href=\"borra.php?cod_servi=%d\">Borra</a></td></tr>", $row["cod_ser"],$row["cod_cli"],$row["nom_eve"],$row["fec_crea"], $row["cod_ser"]);
}
mysql_free_result($result);
descon_db();
?>
</table>
<p>&nbsp;</p>
<table align="center">
<td colspan="6"><div align="center" class="style21">
<h5>
<label></label>
</h5>
<p><span class="style22 style2"><a href="ingresacon.php" target="_parent" class="style22">Regresar al Menu Principal </a></span></p>
</div></td>
</tr>
</table>
</body>
</html>



------------------------------------------
borra.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include("funciones.php");
$link=con_db();
$cod_servi=$_GET['cod_servi'];
mysql_query("delete from servicio_voz where cod_ser=$cod_servi",$link);

header("Location: ejemplo_de_borrar.php");
?>

<?php

$cod_servi=$_POST['cod_servi'];
mysql_query("delete from servicio_video where cod_ser=$cod_servi",$link);

header("Location: ejemplo_de_borrar.php");
?>

<?php

$cod_servi=$_POST['cod_servi'];
mysql_query("delete from servicio_datos where cod_ser=$cod_servi",$link);

header("Location: ejemplo_de_borrar.php");
?>


</body>
</html>