No me lo renombra, lo sigue subiendo con su mismo nombre
colocare el codigo completo
Código PHP:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$ediciondir= '../clipping/';
$uploaddir=$ediciondir;
if (!is_dir($ediciondir)) { mkdir($uploaddir, 0777); }
$nombre = md5(rand().time()).".".$info['extension'];
move_uploaded_file($_FILES['img']['tmp_name'], $uploaddir . $_FILES['img']['name']);
$filename = $_FILES['img']['name'];
$insertSQL = sprintf("INSERT INTO clipping (id, img) VALUES (%s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($filename, "text"));
mysql_select_db($database_azimut, $azimut);
$Result1 = mysql_query($insertSQL, $azimut) or die(mysql_error());
$insertGoTo = "ing_clipping.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
formulario
Código PHP:
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1" enctype="multipart/form-data">
<br />
<table align="center">
<tr valign="baseline">
<td align="right" nowrap="nowrap" class="textoprincipal"><div align="right"></div></td>
<td><div align="left"><input type="hidden" name="id_prod" value="<?php echo $row_Recordset2['id']; ?>" />
</div></td>
</tr>
<tr valign="baseline" bordercolor="#CCCCCC">
<td align="left" valign="top" class="textoprincipal"><div align="right" class="text2">Imagen:</div></td>
<td><div align="left">
<input name="img" type="file" class="textoprincipal" id="img" enctype="multipart/form-data" />
</div></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" class="botones" value="Ingresar" /></td>
</tr>
</table>
<input type="hidden" name="id" value="" />
<input type="hidden" name="MM_insert" value="form1" />
</form>
donde está mi error?