.I have the following codes for uploading an image into a server directory, what i want to do is to resize the image before uploading. is this possible? Any help will be much appreciated. Thanks in advance!
if ((($image["type"] == "image/gif")
|| ($image["type"] == "image/jpeg")
|| ($image["type"] == "image/pjpeg")
||($image["type"] == "image/png")))
{
if ($image["error"] > 0)
{
echo "Return Code: " . $image["error"] . "<br />";
}
else
{
echo $studentno;
echo "Upload: " . $image["name"] . "<br />";
echo "Type: " . $image["type"] . "<br />";
echo "Size: " . ($image["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $image["tmp_name"] . "<br />";
$newname = time().$image["name"];
move_uploaded_file($image["tmp_name"],"$dir" . $newname);
echo "Stored in: " . "$dir" . $newname;
else
{
echo '<form method="post" id="display" action="Edit.php">';
echo '<input type="button" VALUE="Error" onClick="alert(Welcome to the Groan Zone!)">';
echo '</form>';
}