I am making a file uploader and this is what I have so far:
if ($submit){
if ($type=='text'){
if (strlen($avtext) >= 36) {
echo "Your custom title is more than 36 characters long.<br>Please go back and fix it.";
exit;
}
$avtext=htmlentities($avtext);
$avtext=eregi_replace("<b>","<b>",$avtext);
$avtext=eregi_replace("</b>","</b>",$avtext);
$avtext=eregi_replace("<i>","<i>",$avtext);
$avtext=eregi_replace("</i>","</i>",$avtext);
$avtext=eregi_replace("<u>","<u>",$avtext);
$avtext=eregi_replace("</u>","</u>",$avtext);
$newav=$avtext;
}
if ($type=='image'){
if (copy($avurl, "avatars/".$username."-".$avurl_name)) {
$avurl_location = "avatars/";
$avurlsize=getimagesize("avatars/".$username."-".$avurl_name);
if ($avurlsize[0] == 0 OR $avurlsize[0] >= 61 OR $avurlsize[1] == 0 OR $avurlsize[1] >= 61 ) {
echo "Your image is over 60 pixels, or nonexistant.";
echo "<br>Please go back and fix this.";
exit;
}
$newav="<img src='avatars/".$username."-".$avupload_name."'>";
}
}
if ($type=='upload'){
if (copy($avupload, "avatars/".$username."-".$avupload_name)) {
$avupload_location = "avatars/";
//Deletes file in TMP directory
unlink($avupload);
$avupsize=getimagesize("avatars/".$username."-".$avupload_name);
if ($avupsize[0] == 0 OR $avupsize[0] >= 61 OR $avupsize[1] == 0 OR $avupsize[1] >= 61 ) {
echo "Your image is over 60 pixels, or nonexistant.";
echo "<br>Please go back and fix this.";
exit;
}
$newav="<img src='avatars/".$username."-".$avupload_name."'>";
}
}
echo "Success.";
mysql_query("UPDATE `users` SET tittext='$newav' WHERE username='$username'");
Whenever I try to upload a pic, it says
Warning: Unable to open 'C:\Documents and Settings\Scott\Desktop\hi.gif' for reading: No such file or directory in /usr/home/sites/www.damakalaka.com/web/overboards/change3.php on line 99