I think the issue is here:
/// images code starts here
if(isset($_FILES["photo1"]["tmp_name"])&& $_FILES["photo1"]["tmp_name"]!="")
{
$file_temp = $_FILES['photo1']['tmp_name'];
$original_file_name = $_FILES['photo1']['name'];
$new_file_name = time().$original_file_name;
$filepath = "../temp_files/".$new_file_name;
move_uploaded_file( $file_temp , $filepath );
// Creating Full Image
$thumbnail = "FULL".$new_file_name;
$thumbnailpath = "../temp_files/".$thumbnail;
$imageBoxSize = 207;
list($fileWidth,$fileHeight, $image_type)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
switch ($image_type)
{
case 1: $src = imagecreatefromgif($filepath); break;
case 2: $src = imagecreatefromjpeg($filepath); break;
case 3: $src = imagecreatefrompng($filepath); break;
default: trigger_error('Unsupported filetype!', E_USER_WARNING); break;
}
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Creating Thumbnail
$thumbnail = "TN".$new_file_name;
$thumbnailpath = "../temp_files/".$thumbnail;
$imageBoxSize = 50;
list($fileWidth,$fileHeight)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
$src = imagecreatefromjpeg($filepath);
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Creating MainPage Thumbnail
$thumbnail = "MAIN".$new_file_name;
$thumbnailpath = "../temp_files/".$thumbnail;
$imageBoxSize = 87;
list($fileWidth,$fileHeight)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
$src = imagecreatefromjpeg($filepath);
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Deleting Original File
unlink($filepath);
$_SESSION['photo1'] = $new_file_name;
}
if(isset($_FILES["photo2"]["tmp_name"])&& $_FILES["photo2"]["tmp_name"]!="")
{
$file_temp = $_FILES['photo2']['tmp_name'];
$original_file_name = $_FILES['photo2']['name'];
$new_file_name = time().$original_file_name;
$filepath = "temp_files/".$new_file_name;
move_uploaded_file( $file_temp , $filepath );
// Creating Full Image
$thumbnail = "FULL".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 207;
list($fileWidth,$fileHeight, $image_type)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
switch ($image_type)
{
case 1: $src = imagecreatefromgif($filepath); break;
case 2: $src = imagecreatefromjpeg($filepath); break;
case 3: $src = imagecreatefrompng($filepath); break;
default: trigger_error('Unsupported filetype!', E_USER_WARNING); break;
}
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Creating Thumbnail
$thumbnail = "TN".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 50;
list($fileWidth,$fileHeight)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
$src = imagecreatefromjpeg($filepath);
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Deleting Original File
unlink($filepath);
$_SESSION['photo2'] = $new_file_name;
}
if(isset($_FILES["photo3"]["tmp_name"])&& $_FILES["photo3"]["tmp_name"]!="")
{
$file_temp = $_FILES['photo3']['tmp_name'];
$original_file_name = $_FILES['photo3']['name'];
$new_file_name = time().$original_file_name;
$filepath = "temp_files/".$new_file_name;
move_uploaded_file( $file_temp , $filepath );
// Creating Full Image
$thumbnail = "FULL".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 207;
list($fileWidth,$fileHeight, $image_type)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
switch ($image_type)
{
case 1: $src = imagecreatefromgif($filepath); break;
case 2: $src = imagecreatefromjpeg($filepath); break;
case 3: $src = imagecreatefrompng($filepath); break;
default: trigger_error('Unsupported filetype!', E_USER_WARNING); break;
}
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Creating Thumbnail
$thumbnail = "TN".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 50;
list($fileWidth,$fileHeight)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
$src = imagecreatefromjpeg($filepath);
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Deleting Original File
unlink($filepath);
$_SESSION['photo3'] = $new_file_name;
}
if(isset($_FILES["photo4"]["tmp_name"])&& $_FILES["photo4"]["tmp_name"]!="")
{
$file_temp = $_FILES['photo4']['tmp_name'];
$original_file_name = $_FILES['photo4']['name'];
$new_file_name = time().$original_file_name;
$filepath = "temp_files/".$new_file_name;
move_uploaded_file( $file_temp , $filepath );
// Creating Full Image
$thumbnail = "FULL".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 207;
list($fileWidth,$fileHeight, $image_type)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
switch ($image_type)
{
case 1: $src = imagecreatefromgif($filepath); break;
case 2: $src = imagecreatefromjpeg($filepath); break;
case 3: $src = imagecreatefrompng($filepath); break;
default: trigger_error('Unsupported filetype!', E_USER_WARNING); break;
}
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Creating Thumbnail
$thumbnail = "TN".$new_file_name;
$thumbnailpath = "temp_files/".$thumbnail;
$imageBoxSize = 50;
list($fileWidth,$fileHeight)=getimagesize($filepath);
if($fileHeight > $fileWidth)
{$unit = $fileWidth/$fileHeight; $width = $imageBoxSize * $unit; $height = $imageBoxSize;}
else
{$unit = $fileHeight/$fileWidth; $height = $imageBoxSize * $unit; $width = $imageBoxSize;}
$src = imagecreatefromjpeg($filepath);
$tmp = imagecreatetruecolor($width,$height);
imagecopyresampled($tmp,$src,0,0,0,0,$width,$height,$fileWidth,$fileHeight);
if(imagejpeg($tmp,$thumbnailpath,100));
//Deleting Original File
unlink($filepath);
$_SESSION['photo4'] = $new_file_name;
}
/// images code ends here
I didnt know if I should show the entire file or not.....I'm new!