July 15, 200818 yr hello again i have created a php script that works in php my admin but i carnt get it work on a server how do i put the images to the say upload folder i have created a folder called uploads and anothe called tmp_name and put them to the server is this correct then i have the following scropt that sends me the email but does not upload the file to the server thanks <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/JPG") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 2000000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 20000000) . " mb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("uploads/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "uploads/" . $_FILES["file"]["name"]); echo "Stored in: " . "uploads/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 20000) . " mb<br />"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } $name = $_POST ['name']; $subject = $_POST ['subject']; $email = $_POST ['email']; $text = $_POST ['text']; $text2 = $_POST ['text2']; $filename = $_FILES ['filename']; $phone = $_POST ['phone']; $time = $_POST ['time']; $company =$_POST ['company']; $email_message = "name {$name} email {$email} subject {$subject} Company name {$company} phone number {$phone} Time to call {$time} how you found me {$text2} image1 {$filename} image2 {$filename1} image3 {$filename2} comments {$text}"; ini_set("sendmail_from", "me@mydomain.co.uk"); mail ('me@mydomain.co.uk' , $subject ,$email_message ); ?> thank you again
Create an account or sign in to comment