Tngo un panel de control el cual me muestra una lista de articulos y me da la opcion de editar o borrar.... ahora, cuando voy a hacerle click no me agarra los articulos es decir no extrae el id de la base de datos... alguien podria ayudarme?
Código PHP:
<?php require_once('../../Connections/listproduc.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_listproduc, $listproduc);
$query_Recordset1 = "SELECT * FROM noticias";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $listproduc) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo16 {color: #FFFFFF}
-->
</style>
<link href="../../css/estilo.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript">
function validar_archivo(archivo) {
var error_archivo;
error_archivo=0;
var file=archivo.value;
if (file=="")
{ error_archivo=1; }
//texto += "\n\nIngrese Foto"
else{
// file=document.formulario.FOTO.value
extArray = new Array(".gif",".jpg");
// Extension de archivos permitidos
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i=0; i < extArray.length; i++){
if (extArray[i] == ext){
allowSubmit = true;
break;
}
}
if (!allowSubmit) {
error_archivo=2;
// texto += "\n\nFOTO: solo admite archivo con la extensión ''gif, .jpeg , .jpg''";
}
}
return error_archivo;
}
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #000000}
.style4 {font-weight: bold}
.style2 {font-weight: bold}
.style3 { font-weight: normal
}
-->
</style>
</head>
<body>
<div align="center">
<TABLE height=243 cellSpacing=0 cellPadding=0 width=698
background=../../images2/img/med.gif border=0>
<CENTER>
<TBODY>
<TR>
<TD width="100%" height=50 align="left" valign="top"><img src="../../images/panel.jpg" width="698" height="100"></TD>
</TR>
</CENTER>
<CENTER>
</CENTER>
<TR>
<TD width="100%" height=160 vAlign=top>
<TABLE width=698 border=0 cellPadding=0 cellSpacing=0 bordercolor="#FF0000" id=table2>
<TBODY>
<TR>
<TD width="8" vAlign=top > </TD>
<TD width="156" vAlign=top class="nucomplet" ><?php include("../modulos/indexbarra.php"); ?>
</TD>
<TD width=10 vAlign=top> </TD>
<TD width=13 vAlign=top> </TD>
<TD width=498 align="center" vAlign=middle class="nucomplet"><span class="unnamed1"><a href="ingresar.php"> Insertar Noticias </a><span class="style1">-</span><a href="listado.php"> Administrar Noticias</a></span>
<table width="552" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="700" height="242"><p> </p>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0" class="text">
<tr>
<td class="negro_verd_nrm"><div align="center"><strong>
<?=$msj?>
</strong></div></td>
</tr>
</table>
<br />
<table width="473" height="16" border="0" align="center" cellpadding="0" cellspacing="0" class="text">
<tr>
<td width="10"> </td>
<td width="690" class="negro_verd_nrm"><span class="azulgrs_tah"><strong>Listado de Noticias:</strong></span></td>
</tr>
</table>
<br />
<table width="536" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="537"><table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
</table></td>
</tr>
</table>
<table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
<tr class="azulgrs_tah">
<td width="110" class="style3"><div align="center" class="style3"><strong>Titulo</strong></div></td>
<td width="254"><div align="center"><span class="style3 style1 style2"><strong>Contenido</strong></span></div></td>
</tr>
<tr class="negro_verd_nrm">
<td height="20" colspan="3" class="azulgrs_tah"><?php do { ?>
<table width="467" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EBEBEB" class="text">
<tr class="negro_verd_nrm">
<td width="110" height="20" class="azulgrs_tah"><div align="center" class="style3 style100"><?php echo $row_Recordset1['titulo']; ?></div></td>
<td width="254" class="azulgrs_tah"><div align="center"><?php echo $row_Recordset1['contenido']; ?></div></td>
<td width="95"><div align="center" class="style3 style100"><span class="style101"><?php echo "<a href='edita_noticias.php?id=".$row['id']."'>Editar</a>"; ?> / <?php echo "<a href='borra_noticias.php?id=".$row['id']."'>Borrar</a>"; ?> </span></div></td>
</tr>
</table>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?></td>
</tr>
</table> <p> </p></td>
</tr>
</table></TD>
<TD width=13 vAlign=top> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD width="100%" height=33 valign="top" bgcolor="#FFFFFF" class="Estilo16"> </TD>
</TR>
</TABLE>
</div>
<p align="center"> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>