Jump to content

Forms in array Help


clanstyles

Recommended Posts

Well its up there but ive changed some things.. Sorry. I bump because i need this and the rules say I can every few hours if nobody responds.

 

                            				$i=1;
										while ($i < 3)
										{
											if ($_FILES['image'.$i]['type'] == "image/jpeg" || $_FILES['image'.$i]['type'] == "image/jpg"
												 || $_FILES['image'.$i]['type'] == "image/pjpeg" || $_FILES['image'.$i]['type'] == "image/gif"){
												$count++;
												$file_name = "";
												$file_name .= "temp.";
												$file_name .= str_replace(".jpg","",str_replace("/","",str_replace("image","",$_FILES['imagefile'.$i]['type'])));  //Replaces to lowercase only .jpg files
												$ext = ".jpg";
												$random_digit = rand(1, 999);
												//Lets make a new name
												$new_file_name=$random_digit.$us.$count.$ext;
												//Lets Path it
												$path[$count]= "uploadimages/".$new_file_name;

												if(copy($_FILES['imagefile'.$i]['tmp_name'], $path[$count])){
													echo "It Copied!!!<br/>";
												}
												else{
													echo "copy Failed<br/>";
												}

											}
											$i++;
										}

 

What I need though is for it to implode the images at the end. All the names I mean.

 

What I really need is somthing that allows others to upload images. Like up to 3. I have three fields allready setup. image1 image2 image3. I need it so they can submit, gifs, jpgs, jpegs, pngs ect.. what ever they require. Then it stores it with a random name lik 12312.gif to a dir uploadedimages/. implodes the name for each image with a | seperating it. Later i have an explode that puts the image sout ( have that all done. )

 

Thank You

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.