Click to See Complete Forum and Search --> : CGI form mail help


katlee49
05-12-2005, 09:53 PM
Can anyone out there help me with this? Here is the perls script in my cgi-bin-
#!/usr/bin/perl
$sendto = "pray\@stpaulslutheranchurch-colon.org"
$ccto = "webmaster\@stpaulslutheranchurch-colon.org"
$useLib="sendmail"
$mailprog = '/usr/sbin/sendmail -I -t ';
@referers = ('stpaulslutheranchurch-colon.org' , '12.164.25.86');

<input type=hidden name="recipient" value="pray@stpaulslutheranchurch-colon.org,webmaster@stpaulslutheranchurch.org">
<input type=hidden name="required" value="yourname,youremail">
<input name="reason">
<input name="request">
<input type=hidden name="redirect" value="http://www.stpaulslutheranchurch.org/thankyou.html">

This is a cgi template I made and put into the cgi-bin (maybe not needed?) in ASCII-

To: pray@stpaulslutheranchurch-colon.org,webmaster@stpaulslutheranchurch-colon.org
Subject: Prayer request

Name? [required-yourname]
Email address? [required-youremail]
Reason for request? [reason]
Prayer request [request]

Here is the form section from my html form which is located in my public_html folder -

<form method="post"
ACTION="http://stpaulslutheranchurch-colon.org/cgi-bin/formmail.cgi">
<p align="left">
Your name
<input name="yourname" size=71>
<p align="left">
Your email address
<input name="youremail" size=57><p>
<p align="center">
Reason for your request
<p align="left">
<input type="radio" name="reason">Anniversary
<input type="radio" name="reason">Blessings
<input type="radio" name="reason">Birth
<input type="radio" name="reason">Hospital
<input type="radio" name="reason">Illness
<input type="radio" name="reason" value="do" checked="checked">Unsaved
<p align="center">
<input type="radio" name="reason">Other<p>


<textarea name="prayer request" rows=20 cols=80>Enter your prayer request here.
</textarea>
<p align="center">
<input type="submit" value="SEND">
<input type="reset" value="RESET">
</form></div>

Really hoping that one of you gurus will take time to look at all this. My host wasn't really very helpful. Gave my the path to perl, path to sendmail and said "The correct way to access it via the web is http://yourdomain.com/cgi-bin/."
Thank you so much. I have spent quite a few hours trying to figure this out as I am a NEWBIE. :eek:

jimr451
05-13-2005, 02:48 PM
Hmmm,

Seems like you might benefit from getting a "canned" script, and trying to install it.

I wrote a free one a while back, you are welcome to try it:

http://www.robertswebforge.com/scripts/index.shtml

It's pretty easy to install, and configure the fields that you need for your site.

Hope this helps.

-Jim

katlee49
05-16-2005, 03:27 PM
Thanks, Jim.
I made only the changes needed (I think) to the perl script. I am getting some form output back! Exciting!
The biggest problem now is that after I submit the form, I don't get the thank you message emailed to me nor does my thankyou.html doesn't come up. I did keep my html page with the form (instead of using yours) as it was all formatted, etc. I suppose the problem is in that. After I submit the form I am on a blank webpage at http://www.stpaulslutheranchurch-colon.org/cgi-bin/mailto.cgi
Also I can't get my radio buttons to work. Any chance you could take a quick look at this part of my form page here (the HTML is sloppy!! been using a WYSIWYG program for most of it)
Thank you for your help. I will get it yet!!!
Kathy




<div id="Oobj177">
<div id="Gcode177" class="dfltt">
<h2 align="left" Let us pray for you!</h2>
<p>Just fill out this form with your prayer request. It will be held in confidence, not posted on our website or published in any manner.<p>It will go directly to the St. Paul's Prayer Chain and we will pray for you!</p>

<form method=post action="http://www.stpaulslutheranchurch-colon.org/cgi-bin/mailto.cgi">
<p align="left">
Your name
<input name="NAME" size=71>
<p align="left">
Your email address
<input name="EMAIL" size=57><p>
<p align="center">
Reason for your request
<p align="left">
<input type="radio" name="REASON" value="Anniversary">Anniversary
<input type="radio" name="REASON" value="Blessings">Blessings
<input type="radio" name="REASON" value="Birth">Birth
<input type="radio" name="REASON" value="Hospital">Hospital
<input type="radio" name="REASON" value="Illness">Illness
<input type="radio" name="REASON" value="Unsaved" checked>Unsaved
<p align="center">
<input type="radio" name="REASON" value="Other">Other<p>


<textarea name="REQUEST" rows=20 cols=80>Enter your prayer request here.
</textarea>
<p align="center">
<input type="submit" value="SEND">
<input type="reset" value="RESET">
</form></div>
</div>

katlee49
05-16-2005, 04:58 PM
Hey, Jim!
I fixed the radio button. Now the only problem is the thank you email and the redirect?

katlee49
05-16-2005, 11:54 PM
Jim,
Thanks for your help and script. I tweaked a few things in my HTML form and now everything seems to be working just fine!
(What will my next problem be???!!)
Thanks again. Your script was the most straightforward of the ones I looked at.
Kathy :)

BDSax
06-06-2005, 05:49 PM
im trying to use this on my form (located here "http://www.bdsax.com/1/shopcartindex.html")



HOW DO I DO THIS!!!! i tried asking my hosting company (ipower) and they didnt know anything! PLEASE HELP! Thank you so much

Billy