Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/02/2008, 12:02
Licrat
 
Fecha de Ingreso: enero-2008
Mensajes: 58
Antigüedad: 17 años, 1 mes
Puntos: 1
rename() no funciona URGENTE

tengo este codigo :
Código:
<?
$servidor = "localhost";
$usuario = "";
$contrasenia = "";

$cnx = mysql_connect($servidor,$usuario,$contrasenia) or die(mysql_error());

mysql_select_db("guiamusica_bd",$cnx) or die (mysql_error());
?>
<!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>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.transparente {
	background-color: transparent;
	font-family: HandelGotDLig;
	font-size: 12px;
	color: #000000;
	width: 600px;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
}
.cwe {	font-family: HandelGotDLig;
	font-size: 12px;
	color: #000000;
	background-color: #FFFFFF;
	border: 1px outset #000000;
	vertical-align: middle;
}
.cwe1 {	font-family: HandelGotDLig;
	font-size: 12px;
	color: #FFFFFF;
	background-image: url(../imagenes/fondo%20botones.jpg);
	background-repeat: no-repeat;
	background-position: center center;
	font-weight: bold;
	width: 100px;
}
body {
	margin-left: 50px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
  <table width="750" border="0">
    <?
		$foto = $_GET["foto"];
		$consulta = "SELECT * FROM fotos WHERE foto='$foto'";
		$query = mysql_query($consulta) or die (mysql_error());
		
		$filas = mysql_num_rows($query);
		
		if($filas>0)
		{
		while($res = mysql_fetch_array($query))
		{
		?>
    <tr class="cwe">
      <td height="34" class="cwe"><div align="center">
          <input name="nombre" type="text" class="transparente" value="<? echo $res["foto"]; ?>"/>
            </div>        
        </td>
      <td width="82" class="cwe"><input name="editar" type="submit" class="cwe1" value="Guardar cambios"/>
     </td>
    </tr>
    <?
	}
	} 
	else 
	{
	echo "<div class='letra'>no hay fotos</div>";
	}
   ?>
   	<?
	if(isset($_POST["editar"]))
	{
	$foto2 = $_POST["nombre"];
	$foto1 = $_GET["foto"];
		 
	$consulta = "UPDATE fotos SET foto='$foto2' WHERE foto='$foto1'";
	$query = mysql_query($consulta) or die (mysql_error());
	
	$ruta1 = 'fotos/'.$_GET["grupo"].'/'.$_GET["foto"];
	$ruta = 'fotos/'.$_GET["grupo"].'/'.$_POST["nombre"];
	
	rename($ruta1,$ruta);
	}
	?>
  </table>
</form>
</body>
</html>
<?
mysql_close($cnx);
?>
al darle a editar, edita perfectamente en la base de datos, pero al editar el nombre de la carpeta pone esto :

Warning: rename(fotos/prueba/Tough_Enough__by_jjean2,fotos/prueba/Tough_Enough__by_jjean21): No such file or directory in c:\appserv\www\guiaweb\backofficce\marco edicion editar foto.php on line 96

¿que tengo mal?
Un saludo!