Hi, using this code:
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
preg_match('/\.([a-zA-Z]+?)$/', $_FILES['file']['name'], $matches);
if(in_array(strtolower($matches[1]), $accepted)) {
if($_FILES['file']['size'] <= $maxsize) {
$newname = md5_file($_FILES['file']['tmp_name']).'.'.$matches[1];
move_uploaded_file($_FILES['file']['tmp_name'], $filedir.'/'.$newname);
$linkurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).'#'.$newname;
$imgurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\/([^\/]+?)$/', '/', $_SERVER['PHP_SELF']).$filedir.'/'.$newname;
print '<h2>Upload Successful!</h2> <p id="codes"><label for="codebb">Embed on bulletin boards:</label><br />
<input type="text" id="codebb" value="[URL='.$linkurl.'][IMG]'.$imgurl.'[/IMG][/URL]" onclick="javascript:this.focus();this.select();" readonly="true" /><br />
<label for="codehtml">Embed on webpages or MySpace: </label><br />
<input type="text" id="codehtml" value=\'<a href="'.$linkurl.'"><img src="'.$imgurl.'" alt="Image hosting by '.$title.'" /></a>\' onclick="javascript:this.focus();this.select();" readonly="true" /><br />
<label for="codedirect">Direct link:</label><br />
<input type="text" id="codedirect" value="'.$imgurl.'" onclick="javascript:this.focus();this.select();" readonly="true" /></p>';
} else
print '<p>Sorry, that file is too big.</p>';
} else
print '<p>Sorry, that file type is not supported.</p>';
}
?>
How would I make it so that it will copy the image that was uploaded, resize and it make the quality 25%, then rename it with the ending _thumbs.<extension>? And after it does that, it moves the file to a directory /board/uploads/thumbs/?