Thats why i think it is so strange. I dont have access to those logs as it is a commercial host.
here is the code
if ($_FILES['pic1']['error'] == 0) {
$dir="/home/u1/wildfire/html/upload_pics/";
srand((double)microtime()*1000000);
$unique_str = md5(rand(0,9999999));
// This code will grab everything before and after the last dot and turn
// it into the new filename.
$old_name = $_FILES['pic1']['name'];
$p = strrpos( $old_name , "." );
$new_name1 = substr( $old_name , 0 , $p ) . $unique_str . substr( $old_name , $p , ( strlen( $old_name ) - $p ) );
$FILENAME = $new_name1;
$RESIZEWIDTH=400;
$RESIZEHEIGHT=400;
function ResizeImage1($im,$maxwidth,$maxheight,$name){
$dir="/home/u1/wildfire/html/upload_pics/";
$width = imagesx($im);
$height = imagesy($im);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)){
if($maxwidth && $width > $maxwidth){
$widthratio = $maxwidth/$width;
$RESIZEWIDTH=true;
}
if($maxheight && $height > $maxheight){
$heightratio = $maxheight/$height;
$RESIZEHEIGHT=true;
}
if($RESIZEWIDTH && $RESIZEHEIGHT){
if($widthratio < $heightratio){
$ratio = $widthratio;
}else{
$ratio = $heightratio;
}
}elseif($RESIZEWIDTH){
$ratio = $widthratio;
}elseif($RESIZEHEIGHT){
$ratio = $heightratio;
}
$newwidth = $width * $ratio;
$newheight = $height * $ratio;
if(function_exists("imagecopyresampled")){
$newim = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}else{
$newim = imagecreate($newwidth, $newheight);
imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}
ImageJpeg ($newim,$dir.$name,95);
ImageDestroy ($newim);
}else{
ImageJpeg ($im,$dir.$name,95);
}
}
if($_FILES['pic1']['size']){
if($_FILES['pic1']['type'] == "image/pjpeg"){
$im = imagecreatefromjpeg($_FILES['pic1']['tmp_name']);
}elseif($_FILES['pic1']['type'] == "image/x-png"){
$im = imagecreatefrompng($_FILES['pic1']['tmp_name']);
}elseif($_FILES['pic1']['type'] == "image/gif"){
$im = imagecreatefromgif($_FILES['pic1']['tmp_name']);
}
if($im){
if(file_exists("$FILENAME.jpg")){
unlink("$FILENAME.jpg");
}
ResizeImage1($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
}
}
function imagettftextoutline1($im,$size,$angle,$x,$y,$col,$outlinecol,$fontfile,$text,$width) {
for ($xc=$x-abs($width);$xc<=$x+abs($width);$xc++) {
for ($yc=$y-abs($width);$yc<=$y+abs($width);$yc++) {
$text1 = imagettftext($im,$size,$angle,$xc,$yc,$outlinecol,$fontfile,$text);
}
}
$text2 = imagettftext($im,$size,$angle,$x,$y,$col,$fontfile,$text);
}
$size = getimagesize("/home/u1/wildfire/html/upload_pics/$new_name1");
$source = imagecreatefromjpeg("/home/u1/wildfire/html/upload_pics/$new_name1");
$photo_height = $size[1];
$photo_width = $size[0];
$image = imagecreatetruecolor($photo_width, $photo_height);
$copy = imagecopy($image, $source, 0,0,0,0,$photo_width,$photo_height);
$red = imagecolorclosest($image, 255,0,0);
$white = imagecolorclosest($image,255,255,255);
imagettftextoutline1($image, 12, 0, 3, 20, $white,$red, "/home/u1/wildfire/html/admin/font.ttf", "www.wildfirecharters.com",1);
imagejpeg($image,$dir."$new_name1",100);
}