Newbie formmail help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marinajc
Forum Newbie
Posts: 13
Joined: Tue Aug 24, 2004 11:51 am

Newbie formmail help

Post by marinajc »

I'm using Jack's script for form mail. I'd like to be able to allow the uploading of files. What modifications do I need to make to my form and/or script to do this?

I am new to PHP, so please explain it in simple terms and thanks for your help! :roll:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

marinajc
Forum Newbie
Posts: 13
Joined: Tue Aug 24, 2004 11:51 am

Error

Post by marinajc »

Thanks. I tried that, but I get "page not found" and this "_URL_" appears at the end of my domain.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that page is an example only.. you are supposed to replace _URL_ with your processing script's location.
The "_URL_" in the above example should be replaced, and point to a PHP file. The MAX_FILE_SIZE hidden field (measured in bytes) must precede the file input field, and its value is the maximum filesize accepted. Also, be sure your file upload form has enctype="multipart/form-data" otherwise the file upload will not work.
Which appears just below their example.
marinajc
Forum Newbie
Posts: 13
Joined: Tue Aug 24, 2004 11:51 am

email

Post by marinajc »

Thanks, I didnt get an error, but it never came in my email either. I'm thinking there is something missing in the form. There is no email address in it, so how can it be sent to my email? What should the form say?

Thanks. This is what I have now:

<form enctype="multipart/form-data" action="index.htm" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm not sure how Jack's form mail script works, but generally, there should be a page with the standard form for sending an the email in it, you can insert the MAX_FILE_SIZE and userfile fields into that form, then alter the processing script to take those values into consideration..

there are many threads on this site with file upload processors, and there are a few different threads with how to attach data.. using Phuse may help you search more effectively..
Post Reply