2){
$from = strpos($html, "__STARTM".$i."__");
$to = strpos($html, "__ENDM".$i."__");
$html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);
continue;
}
$imagefilename[$i] = mt_rand(0, 1000).time().'_'.$_FILES["image".$i]["name"];
upload_media($imagefilename[$i],$_POST['image'.$i]);
$deletionArray[] = $imagefilename[$i];
$varList[] = "__image".$i."__";
$valueList[] = $imagefilename[$i];
$start = "__STARTM".$i."__";
$end = "__ENDM".$i."__";
$html = str_replace(array($start,$end),array("",""),$html);
// $serialLineHTML = $serialLineHTML.$fileNameArray[$i-1]."
";
} else {
$from = strpos($html, "__STARTM".$i."__");
$to = strpos($html, "__ENDM".$i."__");
$html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);
}
}
}
if(empty($_POST['clientId'])){
$kk=0;
for($i=1;$i<= 5;$i++){
if(isset($_FILES["image".$i]["name"]) && !empty($_FILES["image".$i]["name"])){
$kk++;
if($kk > 2){
$from = strpos($html, "__STARTL".$i."__");
$to = strpos($html, "__ENDL".$i."__");
$html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);
continue;
}
/* $imagefilename[$i] = mt_rand(0, 1000).time().'_'.$_FILES["image".$i]["name"];
move_uploaded_file($_FILES["image".$i]["tmp_name"], $imagefilename[$i]);
$deletionArray[] = $imagefilename[$i]; */
/* $varList[] = "__image".$i."__";
$valueList[] = $imagefilename[$i]; */
$start = "__STARTL".$i."__";
$end = "__ENDL".$i."__";
$html = str_replace(array($start,$end),array("",""),$html);
// $serialLineHTML = $serialLineHTML.$fileNameArray[$i-1]."
";
} else {
$from = strpos($html, "__STARTL".$i."__");
$to = strpos($html, "__ENDL".$i."__");
$html = str_replace(substr($html,$from,($to-$from)+8+strlen($i)),"",$html);
}
}
}
require("../common_file.php");
} else {
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."RTG-SAGESTREAM-LETTER-for-FREEZE-REQUEST-1.html";
header("Location:".$url);
}
?>