Yes, it might be Java. Still, very thankful for help!
Here is the php-page:
<center>
<table width="600" style="border:solid 1px #000" cellpadding="0" cellspacing="0">
<tr>
<td>
<table width="600" border="0" cellpadding="5" cellspacing="0">
<tr>
<td bgcolor="ffffff"><a href="members.php?display=main">Kontoöversikt</td>
<td bgcolor="ffffff"><a href="members.php?display=editphoto">Ändra foto</a></td>
<td bgcolor="ffffff"><a href="members.php?display=indexphoto">Indexera foto</a></td>
<td bgcolor="ffffff"><a href="members.php?display=editaccount">Kontouppgifter</a></td>
<td bgcolor="ffffff"><a href="members.php?display=addphotomulti">Ladda upp Foton</a></td>
</tr>
</table>
</td>
</tr>
<tr class=table1>
<td width="100%" valign="top">
<?
if(!isset($submitnumber) && !isset($uploadbutton))
{
numberofphotos();
}
if(isset($submitnumber))
{
addphotos($numphotos);
}
elseif(isset($uploadbutton))
{
for($counter=1;$counter<=$numphotos;$counter++)
{
$filename1 = $_FILES['photofile'.$counter.'']['name'];
$filename = strtr($filename1, "åäöÅÄÖ", "aaoAAO");
$query = mysql_query("SELECT * FROM mpgallery_photos WHERE photoUser=$loggedUserID AND photoFile='".$filename."' ") or die ("Error: ".mysql_error());
$numRows = mysql_num_rows($query);
if($numRows>0)
{$exists=true;}
else
{$exists=false;}
if($exists==false)
{
$image_info = getimagesize($_FILES['photofile'.$counter.'']['tmp_name']);
$photowidth = $image_info[0];
$photoheight = $image_info[1];
$photopixelsize = $photowidth."x".$photoheight;
$photodate = date("Y-m-d");
$filesizekb = $_FILES['photofile'.$counter.'']['size']/1024;
settype($filesizekb,'integer');
if($_FILES['photofile'.$counter.'']['type'] == 'image/jpg' || $_FILES['photofile'.$counter.'']['type'] == 'image/jpeg' || $_FILES['photofile'.$counter.'']['type'] == 'image/pjpeg')
{
echo "Type: ".$_FILES['photofile'.$counter.'']['type']."<br>";
move_uploaded_file($_FILES['photofile'.$counter.'']['tmp_name'], "gallery/original/".$loggedUser."/".$filename)
or die ("Could not copy");
/* Resize and create a thumb */
$image_path = "gallery/original/".$loggedUser."/".$filename;
$imgsource = imagecreatefromjpeg($image_path);
if($photowidth>$photoheight)
{
$imgdest = imagecreatetruecolor(90, 60);
imagecopyresized($imgdest, $imgsource, 0, 0, 0, 0,
90, 60, $photowidth, $photoheight);
}
else if($photowidth == $photoheight)
{
$imgdest = imagecreatetruecolor(90, 90);
imagecopyresized($imgdest, $imgsource, 0, 0, 0, 0,
90, 90, $photowidth, $photoheight);
}
else
{
$imgdest = imagecreatetruecolor(60, 90);
imagecopyresized($imgdest, $imgsource, 0, 0, 0, 0,
60, 90, $photowidth, $photoheight);
}
imagejpeg($imgdest,"gallery/thumbs/".$loggedUser."/".$filename,100);
/* Resize and create a full */
$max_width = 500;
$max_height = 500;
$x_ratio = $max_width / $photowidth;
$y_ratio = $max_height / $photoheight;
if (($photowidth <= $max_width) && ($photoheight <= $max_height))
{
$new_width = $photowidth;
$new_height = $photoheight;
}
else if (($x_ratio * $photoheight) < $max_height)
{
$new_height = ceil($x_ratio * $photoheight);
$new_width = $max_width;
}
else
{
$new_width = ceil($y_ratio * $photowidth);
$new_height = $max_height;
}
$text = "© copyright";
$font = 'gallery/impact.ttf';
$imgsource2 = @imagecreatefromjpeg($image_path);
$color = imagecolorallocatealpha($imgsource2, 255, 255, 255, 70);
$imgdest2 = imagecreatetruecolor($new_width, $new_height);
imagettftext($imgsource2, 200, 0, 80, 260, $color, $font, $text);
imagecopyresized($imgdest2, $imgsource2, 0, 0, 0, 0, $new_width, $new_height, $photowidth, $photoheight);
imagejpeg($imgdest2,"gallery/full/".$loggedUser."/".$filename,90);
mysql_query("INSERT INTO mpgallery_photos (photoUser,photoThumb,photoFull,photoFile,photoDate,photoPixelSize,photoFileSize,photoComplete) VALUES
('$loggedUserID','$filename','$filename','$filename','$photodate','$photopixelsize','$filesizekb','no')")
or die ("Error: ".mysql_error());
}
else
{
echo "Error: File type<br>";
}
echo "Temp Name: ".$_FILES['photofile'.$counter.'']['tmp_name']."<br>";
echo "Name: ".$filename."<br>";
echo "Size: ".$_FILES['photofile'.$counter.'']['size']."<br>";
echo "Error: ".$_FILES['photofile'.$counter.'']['error']."<br><br>";
}
else
{
echo $_FILES['photofile'.$counter.'']['name']." finns redan, byt namn på filen.<br><br>";
}
}
echo "<script type='text/javascript'>";
echo "popupoff();";
echo "</script>";
}
?>
<?
function numberofphotos()
{
?> <form name="numphotosform" method="post" action="">
<table border="0" align="center" cellspacing="5">
<tr>
<td><div align="right">Antal foton: </div></td>
<td><select name="numphotos">
<option value="1" selected>01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
<option value="10">10</option>
</select></td>
<td>
<input name="submitnumber" type="submit" id="submitnumber" value="Fortsätt"></td>
</tr>
</table>
</form>
<?
} // end function numberofphotos()
?>
<?
function addphotos($numphotos)
{
?>
<form action="" method="post" enctype="multipart/form-data" name="addphotosform" >
<table border="0" align="center" cellpadding="4" cellspacing="0">
<?
for($counter=1;$counter<=$numphotos;$counter++)
{
?> <tr>
<td align="right">Foto <? echo $counter;?>: </td>
<td><input name="photofile<? echo $counter;?>" type="file" id="photofile<? echo $counter;?>"></td>
</tr>
<?
} // end for($counter=0;$counter==$numphotos;$counter++)
?>
<tr>
<td colspan="2"> <div align="right">
<input name="numphotos" type="hidden" value="<? echo $numphotos;?>">
<input name="uploadbutton" type="submit" id="uploadbutton" value="Ladda Upp" onclick="javascript:popupon();">
</div></td>
<br><br>
</table>
</form>
<?
} // end function addphotos()
?>
</td>
<td></td>
</tr>
<tr class="table1">
<td width="0%" ></td>
<td valign="bottom"></td>
<td></td>
</tr>
</table>
Could it be something with popupoff not knowing what window to close? I'm at lost....