Need cgi help asap
I just got formmail but I have know clue how to do this.
I'm reading the readme file but It just gets me more
Say I wanted the form to be mailed to email@example.com
# Send E-Mail
Is this the correct line for this.
How do I modify ut?
I assume you're talking about FormMail.pl from Matt's script archive?
OK - the first thing you need to know is whether or not your hsot supports Perl and SendMail. Then you need to find out what their path to sendmail and path to Perl is. once you've got that information you need to edit FormMail.pl to reflect these settings. Then upload FormMail.pl to your web server (in the cgi-bin) and CHMOD it to 755. That's the installation sorted.
To use it you need to set up an HTML form targetting it, and then set the HTML form's hidden variables to specify what address you would like the mail sent to, what subject you want etc. The documentation that comes with FormMail will tell you how to do this.
Did you not read my post.
I have know clue how to do these things.
Can you edit FormMail.pl from any text editor or what.
Yes you can edit it in any text editor. I strongly recommend going through the documentation that comes with the script - it's very well written and should explain exactly what you need to do. I'm afraid I can't explain how to use the script any better than the documentation does - however if you've got any specific questions (i.e more specific than "how do I usae it") I'll be happy to answer them :)
Yea I am way confused.
The script has this line # Send E-Mail
but in the readme file has this <input type=text name="email">
So what do I put in the script for the form to be mailed to me?
OK here's a step by step guide.
First of all you need to edit the FormMail.pl script to reflect your server's setting. The important bits of information are your path to sendmail (your host will tell you this) and the path to Perl (which needs to be in the #!/usr/bin/perl line at the top - again ask your host). You also need to add your domain name to the @referrers bit. Basically find the following lines and change them to reflect your settings:
#!/usr/bin/perl (the top line)
$mailprog = '/usr/lib/sendmail';
@referers = ('yourdomain.com');
That is ALL you need to do to the FormMail.pl file - you don't need to change anything else.
Upload it to your server's CGI bin and CHMOD it to 755 - if you don't know how to CHMOD stuff look up "CHMOD tutorial" on google.
That's the script set up. Now you need to creat an HTML page with the form that you would like to e-mail. Here's an example page:
There you go - that will display a form asking for user's comments which will be e-mailed to you when they click the button.
<form action="/cgi-bin/FormMail.pl" method="POST">
<input type=hidden name="recipient" value="firstname.lastname@example.org">
<input type=hidden name="subject" value="Your Subject">
Now you can put the fields you want in the form - here are some examples:<p>
Your Name: <input type=text name=realname><p>
Your E-Mail Address: <input type=text name=email><p>
Your Comments: <textarea name=comments rows=5 cols=30></textarea><p>
<input type=submit value="Submit Form">
There are lots of other "hidden" fields you can add to the script if you want that will change the way the script behaves. A full list of them is available here:
Hope that helps,