hola,estoy haciendo un sistema para editar el contenido de mi web,tengo el siguiente code que no me da error pero no me modifica los datos:
principal<p align="center"><?php
include("config.php");
$link=Conectarse();
$result=mysql_query("select * from videos order by id desc",$link); ?>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 align="center">
<TR><TD> <B>Nombre</B></TD> <TD> <B>ID</B> </TD> <TD> </TD></TR>
<?php
$id = $row["id"];
printf("<tr><td> %s</td><td> %s </td><td><b><a href='editar_video.php?id=$id'>Editar</a></b></td></tr>", $row["nombre"],$row["id"]); }
?>
</table> </p>
editar_video.php<html>
<head>
<title>Enviar video</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-color: #FCF;
}
</style>
</head>
<body><h1 align="center">Editar video</h1>
<p>
<?
include("config.php");
$id=$_GET['id'];
$link=Conectarse();
$result=mysql_query("select * from videos WHERE id=$id",$link); $id = $row["id"];
$nombre = $row["nombre"];
$embed = $row["embed"];
$img = $row["img"];
$dur = $row["dur"];
$porn1 = $row["porn1"];
$porn2 = $row["porn2"];
$cat1 = $row["cat1"];
$cat2 = $row["cat2"];
}
?>
</p>
<form name="form1" method="post" action="editado.php">
<p>Nombre del video:
<input name="nombre" type="text" value="<? echo $nombre ?>" size="40" maxlength="40" />
</p>
<p>Código embed del video:
<label>
<br>
<textarea name="textarea" id="textarea" cols="45" rows="5"><? echo $embed ?></textarea>
</label>
</p>
<p>Ruta de la imagen del video:
<input name="img" type="text" value="<? echo $img ?>" size="50" />
</p>
<p>Duración del video:
<input name="dur" type="text" value="<? echo $dur ?>" size="20" />
</p>
<p>Pornstar 1:
<input name="porn1" type="text" value="<? echo $porn1 ?>" size="40" />
</p>
<p>Pornstar 2:
<input name="porn2" type="text" value="<? echo $porn2 ?>" size="40" />
</p>
<p>Categoría del video:
<label for="select"></label>
<input name="cat1" type="text" value="<? echo $cat1 ?>" size="40" />
</p>
<p>Subcategoría del video:
<input name="cat2" type="text" value="<? echo $cat2 ?>" size="40" />
</p>
<p>
<input type="submit" value="Actualizar" name="ir"/>
</p>
</form>
</body>
</html>
editado.php<html>
<head>
<title>Enviar video</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-color: #FCF;
}
</style>
</head>
<body><h1 align="center">Editar video</h1>
<?
$host="localhost";
$user="userpass";
$db="bd";
//Aqui recibimos las variables a actualizar
$id=$_POST['id'];
$porn1=$_POST['porn1'];
$porn2=$_POST['porn2'];
$nombre=$_POST['nombre'];
$embed=$_POST['embed'];
$cat=$_POST['cat'];
$cat2=$_POST['cat2'];
$img=$_POST['img'];
$dur=$_POST['dur']." minutos";
//Creamos la conexión
//aqui preguntamos si hicieron click en el boton actualizar
if($_POST['ir']=="Actualizar")
{
$sql=mysql_query("update [/videos] set nombre='$nombre', embed='$embed', img='$img', cat1='$cat1', cat2='$cat2', porn1='$porn1', porn2='$porn2', dur='$dur' where [/id]='$id'",$link); echo "Actualizado correctamente";
}
else
{
echo "Error al editar el video.";
}
?>
</body>
</html>
que es lo que está mal? gracias