So I needed after you pict the image and upload the files are saved in two different places but instead of me doing that I broke it and it wont upload anything. There is coments by what I changed.
<html>
<head>
<title>UPLOAD</title>
</head>
<body>
<div align="center">
<style>
td,body
{
font-family: Verdana;
font-size: 10pt;
font-weight: Bold;
}
</style>
<?php
if($_POST['upload'] == 'now')
{
for($i = 0; $i <= $_POST['size']; $i++){
$report_img = '';
$LARGE_IMG_WIDTH = 350;
$LARGE_IMG_HEIGHT = 450;
$IMG_WIDTH = 120;
$IMG_HEIGHT = 190;
$IMG_ROOT = "./Stories";
$IMG_ROOTT = "./OtherStories"; //I added this
$fileName = explode(".", $_FILES['strFile']['name'][$i]);
$name = str_replace(' ', '_', $fileName[0]);
error_reporting(53); //errors may happen for no reason, so this killes them, we will use our own error reporting
$acceptedTypes = array('image/jpeg', 'image/jpg', 'image/pjpeg');
//Check to make sure that the image is a valid type
if(!in_array($_FILES['strFile']['type'][$i], $acceptedTypes) || trim($_FILES['strFile']['tmp_name'][$i]) == "" || trim($_FILES['strFile']['tmp_name'][$i]) =="none"){
echo 'You didnt suply an image a valid image.';
} else {
//Get the size of the uploaded image
$img_orig_size = getimagesize($_FILES['strFile']['tmp_name'][$i]);
$img_orig_width = $img_orig_size[0];
$img_orig_height = $img_orig_size[1];
$img_original = ImageCreateFromJpeg($_FILES['strFile']['tmp_name'][$i]);
//Defines the file name that will be used to store the image
$image_stored = time() . '_' . $_POST['strTitle'][$i] . "_$nameB";
//It will be a resized to LARGE_IMAGE_WIDTH & LARGE_IMAGE_HEIGHT
$mlt_w = $LARGE_IMG_WIDTH / $img_orig_width;
$mlt_h = $LARGE_IMG_HEIGHT / $img_orig_height;
$mlt = $mlt_w < $mlt_h ? $mlt_w:$mlt_h;
#### Calculate new dimensions
$img_new_width = round($img_orig_width * $mlt);
$img_new_height = round($img_orig_height * $mlt);
$newnameB = "LargeStory";
$path = "Stories/";
$pathe = "OtherStories/"; //I added this
if (!file_exists($path)) {
mkdir($path, 0775);
}
$r = 0;
while (file_exists($path.$newnameB.$r.".jpg")) {
$r = $r + 1;
}
$nameR = $newnameB.$r.".jpg";
if (!file_exists($pathe)) {
mkdir($pathe, 0775);
}
//I added this loop
$e = 0;
while (file_exists($path.$newnameB.$e.".jpg")) {
$e = $e + 1;
}
$nameE = $newnameB.$e.".jpg";
$img_resized = imagecreatetruecolor($img_new_width, $img_new_height);
imagecopyresampled($img_resized, ImageCreateFromJpeg($_FILES['strFile']['tmp_name'][$i]), 0 , 0 , 0 , 0, $img_new_width, $img_new_height, $img_orig_width, $img_orig_height);
$BIGimg_name = $nameR;
$BIGimg_nameE = $nameE; //I added this
//Save the resized image
Imagejpeg($img_resized, "$IMG_ROOT/$BIGimg_name");
Imagejpeg($img_resized, "$IMG_ROOTT/$BIGimg_nameE"); //I added this
}
// THUMBNAILING BEGINS
//Now lets make the thumbnailed image for the new resized image that we just created in the last ELSE statement
//the image will need to be resized, as its too big. It will be a thumbnail
$mlt_w = $IMG_WIDTH / $img_orig_width;
$mlt_h = $IMG_HEIGHT / $img_orig_height;
$mlt = $mlt_w < $mlt_h ? $mlt_w:$mlt_h;
#### Calculate new dimensions
$img_new_width = round($img_orig_width * $mlt);
$img_new_height = round($img_orig_height * $mlt);
$newnameS = "SmallStory";
$path = "Stories/";
$pathq = "OtherStories/"; //I added this
if (!file_exists($path)) {
mkdir($path, 0775);
}
$r = 0;
while (file_exists($path.$newnameS.$r.".jpg")) {
$r = $r + 1;
}
$nameS = $newnameS.$r.".jpg";
//I added all this
if (!file_exists($pathq)) {
mkdir($pathq, 0775);
}
$q = 0;
while (file_exists($pathq.$newnameS.$q.".jpg")) {
$q = $q + 1;
}
$nameQ = $newnameS.$q.".jpg";
$img_resized = imagecreatetruecolor($img_new_width, $img_new_height);
imagecopyresampled($img_resized, ImageCreateFromJpeg($_FILES['strFile']['tmp_name'][$i]), 0 , 0 , 0 , 0, $img_new_width, $img_new_height, $img_orig_width, $img_orig_height);
$SMALLimg_name = $nameS;
//Save the resized image
Imagejpeg($img_resized, "$IMG_ROOT/$SMALLimg_name");
Imagejpeg($img_resized, "$IMG_ROOTT/$nameQ"); //I added this
//Delete the canvas
ImageDestroy($img_resized);
$report_img = '';
echo "<img src='$IMG_ROOT/$SMALLimg_name'><br><img src='./OtherStories/$nameQ'><BR>Thank you for your submition.";
// also how do I get this echo to a different window
// I know I have to do it with javaScript but I havent done this
//echo ("msgP=Thank you for your submissions.");
//print "<script language='javascript'>window.close();</script>";
}
}
else {
?>
</div> // the name of this file is OtherStories.php
<form action="OtherStories.php" method="post" name="frmImage" enctype="multipOther/form-data">
<div align="center">
<p>
<input type="hidden" name="upload" value="now">
</p>
<p> </p>
<p> <font face="Verdana, Arial, Helvetica, sans-serif"> Upload your Image</font></p>
</div>
<tr>
<td width="30%" align="center" bgcolor="#FFCC00">
<div align="center"></div></td>
<td>
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif">File:
<input type="file" name="strFile[0]" value="">
</font> </div></td>
</tr>
<tr>
<td width="30%" align="center" bgcolor="#FFCC00"></td>
<td ><div align="center">
<p>
<input type="submit" name="strSubmit" value="Submit Image">
</p>
<p> </p>
</div></td>
</tr>
</form>
<div align="center">
<?php
}
?>
</div>
</body></html>
</body> </html>
[code=php]
thank you for anything that you can do.