whats wrong with this?
what its supposed to do is upload an image (.gif) and put it in the directory "/var/www/html/forum/users/$username/" and name image avatar.gif... but it doesnt do anything...heres the code for the previous page where you chose the file..
PHP Code:
$username = $username1."".$username."";
$password = $password1."".$password."";
$avatar = $avatar1."".$avatar."";
if (empty($avatar))
{
print "No avatar was selected.";
}
else
{
$tempFile = $HTTP_POST_FILES['avatar']['avatar.gif'];
$destination = "/var/www/html/forum/users/$username/" .
$HTTP_POST_FILES['avatar']['avatar.gif'];
copy($tempFile, $destination);
}
what its supposed to do is upload an image (.gif) and put it in the directory "/var/www/html/forum/users/$username/" and name image avatar.gif... but it doesnt do anything...heres the code for the previous page where you chose the file..
PHP Code:
<form method="post" action="/forum/changeavatarprocessor.php">
Username: <input type="text" size="20" name="username" maxlength="16">
<br>
Password: <input type="password" size="20" name="password" maxlength="16">
<br><br>
Avatar: <input type="file" value="" name="avatar" size="20">
<br>
<br>
<input type="submit" value="Change Avatar">
</form>
Comment