Gossamer Forum
Home : General : Perl Programming :

Need a form mail script...

Quote Reply
Need a form mail script...
which will allow for a file to be sent as well as the standard entered info. I would like to have gifs, jpegs sent along with the form. Does anyone know of a script that will do this?
Quote Reply
Re: Need a form mail script... In reply to
Did you check out cgi-resources.com or www.freecode.com?

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------








Quote Reply
Re: Need a form mail script... In reply to
THanks Eliot. Yeah I checked out both these places but there are just a ton of scripts there and rather than play with one I was wondering if someone could recommend one that would allow me to collect data on person, accept an ad gif and then put that gif into circulation as a banner. Any help here would be appreciated. Thanks again for all the help.

Quote Reply
Re: Need a form mail script... In reply to
ELiot,

I just noticed in submitting my site to the links database directory that the form allows for file upload? Is this a script I can download? Can you point me to where I can find this script if it is available? This is exactly what I am looking for.

Quote Reply
Re: Need a form mail script... In reply to
 
Are you talking about a form that you can fill out or click locate from you c: drive and then you can upload something to a specified bin?

Tony
Quote Reply
Re: Need a form mail script... In reply to
Does anyone have any help here? I am desparate for this script?
Quote Reply
Re: Need a form mail script... In reply to
 
I just found one that's written in java, but unbelievably there site went down just as I was going to grab it. I'll keep trying though.

Tony
Quote Reply
Re: Need a form mail script... In reply to
 
I found it! It's in perl at

http://cgi-lib.berkeley.edu/

here is the source code;


#!/usr/local/bin/perl

# Copyright (c) 1996 Steven E. Brenner
# $Id: fup.cgi,v 1.2 1996/03/30 01:35:32 brenner Exp $


require "./cgi-lib.pl";

# When writing files, several options can be set... here we just set one
# Limit upload size to avoid using too much memory
$cgi_lib'maxdata = 50000;


# Start off by reading and parsing the data. Save the return value.
# We could also save the file's name and content type, but we don't
# do that in this example.
$ret = &ReadParse;


# A bit of error checking never hurt anyone
&CgiDie("Error in reading and parsing of CGI input") if !defined $ret;
&CgiDie("No data uploaded",
"Please enter it in <a href='fup.html'>fup.html</a>.") if !$ret;


# Munge the uploaded text so that it doesn't contain HTML elements
# This munging isn't complete -- lots of illegal characters are left as-is.
# However, it takes care of the most common culprits.
$in{'upfile'} =~ s/</</g;
$in{'upfile'} =~ s/>/>/g;


# Now produce the result: an HTML page...
print &PrintHeader;
print &HtmlTop("File Upload Results");
print <<EOT;

<p>You've uploaded a file. Your notes on the file were:<br>
<blockquote>$in{'note'}</blockquote><br>
<p>The file's contents are:
<pre>
$in{'upfile'}
</pre>
EOT

print &HtmlBot;

and here is the form,

<form action="http://yoursite.com/cgi-bin/fileupload.cgi" encType="multipart/form-data" method="post">
File to upload: <input name="upfile" type="file"><br>
Notes about the file: <input name="note" size="20"><br>
<br>
<input type="submit" value="Press"> to upload the file!
</form>

If you need to know more go to that address above, they explain everything.

I hope that will work for you.
Tony
Quote Reply
Re: Need a form mail script... In reply to
Tony you are the man! is there anyway to force an proper email address or is this in the script? sorry I am a novice here but trying to learn. And how about aotorespoder type messages? Thanks again.
Quote Reply
Re: Need a form mail script... In reply to
  
Forgive the lateness of my reply, I've been really busy.

I have no idea about auto responders, But I do know that you can get them for free with most email.
What do you mean by a proper email address?
If you want to learn perl the fast way I know about a lot of great tutorials and websites. I read my first line of perl about 3 weeks ago and I have already made a banner rotation script with a full administration panel, a search engine with a url submitter, and I'll be making an advanced link rating script for a friend of mine. Just let me know if you do. Feel free to email me at my email address,

tony@olbis.com

See ya,
Tony
Quote Reply
Re: Need a form mail script... In reply to
Thanks Tony. Yeah that last message wasn't very clear. Basically I would like to have an email sent to the submitter after the form is submitted saying thanks, blah, blah. Also i would like to have a way to force the submitter to enter in an email address with the proper convention (i.e. joe@youknow.com). That way i won't get any bogus email. Anyway let me know what you think and Eliot if you are out there let me know if you have an input.
Quote Reply
Re: Need a form mail script... In reply to
  
I know there is a way to send a confirmation notice or something thanking them for thier submission, but I don't know about the script checking for an @ sysmbol.
I will look into this further for you.
Quote Reply
Re: Need a form mail script... In reply to
  
Sorry but I've been to busy to do It for you but I think you could do it with the following resources.

I just noticed that links checks for an @ symbol when adding a link in the email field. Maybe you can use that bit of script.
About sending the email, go to

http://www.cgi101.com/class/

and then go to chapter 4. They talk about sending email with perl and they give you the source. You shouldn't have a problem putting the two together.

Tony