Click to See Complete Forum and Search --> : Forms (Text & Attachment)


susha
03-19-2003, 07:20 AM
Hi,

I want to make an HTML form that will send by E-mail Text data as well as an attached file.

The following code doesn't work properly:

***********************************
<html>
<head>
<script>
function redirect() {
setTimeout("window.location='http://www.yahoo.com'",500);
}
</script>
</head>
<body>
<form action="MAILTO:anyone@anywhere.com?subject=Attachment Test" method="post" ENCTYPE="multipart/form-data" onSubmit="redirect()">
<h3>This form sends an e-mail to an E-mail address specified.</h3>
Name:<br>
<input type="text" name="name" value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail" value="yourmail" size="20">
<br>
Comment:<br>
<input type="text" name="comment" value="yourcomment" size="40">
<br><br>
Attach File:
<br><br>
<INPUT TYPE="file" NAME="attachedfile" MAXLENGTH=50 ALLOW="text/*" >
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
*****************************

Please, could you help?

Thanks in advance,

Regards,
Susha John.

requestcode
03-19-2003, 07:25 AM
You need to use a Server Side language such as PHP or Perl to do attachments. Javascript or HTML alone can not do it.

susha
03-20-2003, 10:46 PM
Hi,

Thank you for your message.

Now I've to learn something more to make my website work!

Have a nice time!

-- Susha John

Beauchamp
03-21-2003, 04:55 AM
Hi

Try here for some free cgi scripts:
http://cgi.resourceindex.com/

I used this script successfully
http://www.icthus.net/CGI-City/scripts_mailafile.shtml