pepper Posted July 26, 2010 Share Posted July 26, 2010 hi guys I have a 3 page form that is collecting some information about a music instrument. In the 1st page is just general questions and given answers are through textboxes, radio buttons etc. In the 2nd page where the problems starts is an option for the user to upload images. In the 3rd and final page its just some basic contact info like name, email and phone. When you hit submit you getting an email with the info of the musical instrument given in the form plus an attachment of the picture(s) the user has uploaded. Everything works fine apart from the email which it goes through but with an empty attachment. More specific its a ATT00001 file of 0kb size. Also i get this error message. Warning: fread() [function.fread]: Length parameter must be greater than 0 in /public_html/validate_quote_form.php on line 90. I understand that I need to use fopen() function to open the file and read its size etc. I have tried everything I have read from other people messages but don't seem to be working. Some other info about the form: After the 1st page of the form (quote-form.php) follows a page (getdata.php) where all the data is been validated and variables are saved into session. If it passes that then the 2nd page (quote-form-step2.php) follows where the user can upload one or more images. Then the page (upload.processor.php) follows where it will upload the picture in a specific folder. After that you see the 2nd page again in case you want to keep uploading images (I plan to have a limit of 5 images uploaded). If the user is happy and no more uploading required then user can click a button and move on to the 3rd and last page (quote-form-step3.php) where name, email , phone number are taken. Submitting the form will send the email with all the info and image(s) attachment and ths is from the page (validate_quote_form.php). I must be doing something wrong with the variables or fread() function or losing data from one page to another so the attachment don't work. I've been trying three days now and I'm getting a headache every time I try again to fix it. Can anyone suggest me anything or point me to the right direction? I have a the whole thing online somewhere temporarily where sensitive info has been removed. If anyone wants i can even send the php files somehow. I'm willing even to pay anyone who helps me finish the form. thank you Link to comment https://forums.phpfreaks.com/topic/208933-php-form-image-upload-mail-with-image-attached/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.