Vale ya lo e solucionado ^^ yo pongo el resultado por si a alguien le vale alguna vez :P
Código PHP:
<?php
//Iniciar sesión
session_start();
// Sesión iniciada
if (isset($_SESSION["usuario_valido"]))
{
include("libreria.php");
$conexion=conecta();
if (isset ($_REQUEST['modificar'])){
$errores = false;
//print_r($_REQUEST);
$maxdes = $_REQUEST['max'];
$vida = $_REQUEST['vida'];
$estad = $_REQUEST['estado'];
if ($maxdes=="") {
$error[1]=' Complete la casillas';
$errores=true;}
if ($vida=="") {
$error[2]=' Complete la casilla';
$errores=true;}
print $errores."..........";
}
if (isset ($_REQUEST['modificar']) and $errores==false){
$codarchivo = $_REQUEST['cod'];
$conexion=conecta();
$sq2="update archivos set max_descargas='$maxdes', tiempo_vida='$vida', estado='$estad' where cod_archivo='$codarchivo'";
print $sq2;
$registros2=mysql_query($sq2,$conexion) or
die("Problemas en el update".mysql_error());
echo "Archivo fue modificado";
$pagina="admindescarga.php";
header("Location:$pagina");
}
?>
<!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=iso-8859-1" />
<title>Administrar mis descargas </title>
<link href="stilo.css" rel="stylesheet" type="text/css" />
</head>
<body class="stilo2">
<div id="Layer1">
<?php
//listado subidas
$sql="select * from archivos";
$registros=mysql_query($sql,$conexion) or
die("Problemas en el select:".mysql_error());
print "<p class='stilo5'>Mantenimiento:</p>";
print "<table border='2' cellspacing='0' class='stilo4'>";
print "<tr><td>Nombre archivo</td><td>Tamaño</td><td>Numero descargas</td><td>Max descargas</td><td>Fecha Subida</td><td>Tiempo de vida</td><td>Estado</td></tr>";
while ($reg2=mysql_fetch_array($registros))
{
$estado=$reg2['estado'];
//$id=$reg['cod_archivo'];
print '<form action="admindescarga.php" method="post">';
print '<input size=5 type="hidden" name="cod" value="'.$reg2['cod_archivo'].'">';
print "<tr><td>".$reg2['nombre']."</td>";
print "<td>".$reg2['size']."</td>";
print "<td>".$reg2['num_descargas']."</td>";
print '<td><input size=5 type="text" name="max" value="'.$reg2['max_descargas'].'"></td>';
print ("<font color='#990033'>$error[1]</font><BR>");"</td>";
print "<td>".$reg2['fecha_subida']."</td>";
print '<td><input size=5 type="text" name="vida" value="'.$reg2['tiempo_vida'].'"></td>';
print ("<font color='#990033'>$error[2]</font><BR>");"</td>";
print "<td><select name='estado'>";
print "<option value='-1' ";
if ($estado == -1) { print " selected ";}
print ">Activo</option>";
print "<option value='0' ";
if ($estado == 0) { print " selected ";}
print ">Inactivo</option>";
print "</select>";
print '<td><input type="submit" name="modificar" value="modificar"></td></tr>';
print "</form>";
}
print "</table>";
}
?>
</div>
</body>
</html>
Que gusto da cuando le salen bien las cosas a uno :D