bradgrafelman;11030329 wrote:Retrieve the name of the old file and then use [man]unlink/man to remove it.
So I've done that:
$location = "images/avatars/$name";
$path = "images/avatars/".$HTTP_POST_FILES['image']['name'];
rename($HTTP_POST_FILES['image']['tmp_name'], $path);
$trinti = ("SELECT imageloc FROM user WHERE username='$username'");
unlink();
if ($trinti) {
$query = mysql_query("UPDATE user SET imageloc='$location' WHERE username='$username'");
echo "<script type='text/javascript'>
window.location.reload('../index.php');
window.close();
</script> ";
}
And I don't know if I've done everything right, but magically it's working 😮, but when I go to: images/avatars there is no avatars, but when I log out and log in It was saved. As I said i don't know if I've done everything right and if I did, then i need to fix it 'cause I need to see images/avatars/image.jpg, .png, .jpeg, .gif.
Thanks. 🙂
bradgrafelman;11030329 wrote:Retrieve the name of the old file and then use [man]unlink/man to remove it.
I don't know how to do that, but I think it's a good idea too! Maybe you can tell me how to do that? 🙂
Thanks. 🙂