Lunarpages Web Hosting Forum

Author Topic: Can't quite figure out Form Mail... Help?  (Read 15679 times)

Offline jen123

  • Space Explorer
  • ***
  • Posts: 8
Re: Can't quite figure out Form Mail... Help?
« Reply #15 on: October 19, 2005, 11:07:26 AM »
You are amazing!!!! It works beautifully  :yey:

If I did copy the extra data it was by mistake.
I did get your tests. They were fine--the later tests had the email address in the subject which is great. I will next endeavor to add our own Thank You page but will read your How To first.  I'll also save your .pl file.

Thank you very very much. I'm not sure why you so graciously help so many people, but it sure is appreciated.
Thank you.

Offline gscott66

  • Newbie
  • *
  • Posts: 5
Re: Can't quite figure out Form Mail... Help?
« Reply #16 on: October 23, 2005, 01:23:09 PM »
leighsww,

I am having a similar problem.

Can you please look at my "Form" and give me some advice?

I have downloaded and read the Setting up "NMS FormMail" from forum.

I am very new to CGI, etc.....so there is a missing link somewhere in my understanding of it.

My form was created in DW...if that helps...etc.

Here is the lnik:  http://www.guptonwebdesign.com/get_a_quote.htm

Let me know and I'll send you the modified script, etc.

I made the changes and uploaded to cgi-bin and saved as .pl...would that have affected the ASCII mode, because I didn't change anything in DW...should I upload in  a different FTP program? 

Thanks for your help...

Scott

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #17 on: October 23, 2005, 01:30:47 PM »
Did you look at the server version of the script and is it scrambled when viewing it? Look at it via cPanel.

If it is scrambled, then upload it via cPanel (as cPanel will keep the ASCII format intact).

Did you make sure to set permissions to 755 on the script itself?

Read my post here and follow the permission settings if you didn't:

http://www.lunarforums.com/forum/index.php?topic=28890.msg225117#msg225117
« Last Edit: October 23, 2005, 01:33:48 PM by leighsww »

Offline gscott66

  • Newbie
  • *
  • Posts: 5
Re: Can't quite figure out Form Mail... Help?
« Reply #18 on: October 23, 2005, 01:39:52 PM »
Thank you....

I will read it and verify...I have to sign-out for a day or so and I will get back with you...I have out of town obligations!

Are you linked to this thread? 

Thanks for your help....you do much for this forum and it is greatly appreciated.


Scott




leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #19 on: October 23, 2005, 01:42:42 PM »
When you post back to this thread, I will check in to read it, so have a good/safe trip and we'll take care of you and get your form working upon your return  :thumb:

Offline gscott66

  • Newbie
  • *
  • Posts: 5
Re: Can't quite figure out Form Mail... Help?
« Reply #20 on: November 24, 2005, 12:16:12 PM »
leighsww,

Thank you so much...it works!

Sorry it took so long to get back, but it was a crazy month.

How about test it @ http://www.guptonwebdesign.com/get_a_quote.htm

I still need to re-format and dress up the page, but it functions.

I also changed the subject and success page...can I change the From: nobody@lunar?

I found something on the forum, but it seemed PHP related.

When you test it...please offer any advice on other improvements.

Once again thank you for all that you do!  And I look forward to talking to you again!

Scott

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #21 on: November 24, 2005, 12:27:44 PM »
Welcome back, Scott! Happy Thanksgiving!  :love:

Tested your form and everything was/looked A-OK  :thumb:

Oh, read Step 3 under "THE HTML FORM" section of the NMS FormMail tutorial to add the "required" hidden tag for the "email" variable to not have that "nobody@server.lunarpages.com" show up in the "From:":

http://www.lunarforums.com/forum/index.php?topic=18221.0

Normally, that "nobody@server.lunarpages.com" would be what Step 2 says, but since I looked at your source code and you have "email" written in all lower case for that field, it would then be due to leaving that email field blank, so you'll want to make that a required field.
« Last Edit: November 24, 2005, 12:36:21 PM by leighsww »

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #22 on: November 24, 2005, 12:33:13 PM »
I see you are currently online, so read my above post again, because I edited it while you might have been reading the old version  :D

Offline gscott66

  • Newbie
  • *
  • Posts: 5
Re: Can't quite figure out Form Mail... Help?
« Reply #23 on: November 24, 2005, 12:46:54 PM »
Once again thank you....

Step 3 did it....

and Happy Thanksgiving to you as well...

I put the fields in a table and they dressed-up rather nice!

These forums are a life saver...I think I'll try some other cool LunarTools for my site!

Are there any other LunarTools that will add value to my freelancing?

Scott

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #24 on: November 24, 2005, 01:07:59 PM »
Make sure you check out the "Search Engine Traffic" section of these forums:

http://www.lunarforums.com/forum/index.php?board=15.0

To get tips/techniques on getting good rankings from Google, etc.

I also would recommend that you not put your email address directly on your page(s), you're a sitting duck for bot email harvesting. Here's a link to encrypt your email address:

http://www.dynamicdrive.com/emailriddler/

Or, you can just create a "Contact Us" form and use the NMS FormMail to process it.

Offline fthrw

  • Newbie
  • *
  • Posts: 3
Re: Can't quite figure out Form Mail... Help?
« Reply #25 on: December 07, 2005, 08:14:07 PM »
Hi,

I seem to be having trouble with this NMS script too. We were using phpMyFormMail until it was discovered it had a security flaw. So now I've installed NMS and I just can't get it to work. I've read the directions, gone step by step, checked that the file was uploaded as ASCII, is readable in cPanel, has 755 permissions, the form action line is pointing at the right file and still I constantly get error 500 and the log says
Premature end of script headers: /home/fthrw02/public_html/cgi-bin/FormMail.pl

I know I must be doing something really stupid here because I've done scripts before and it CAN'T be this difficult to set this thing up. :-) I've even tried crazy things like changed the file name from .cgi to .pl as if that would make a difference. I'm out of ideas...

The form page I'm trying to get working is:

http://fthrw.com/contest/goldengateway/gg-elec-entryform-TEST.php

Any help you can give me will be MOST appreciated.

Thank you.

Cathy Chant
FTHRW Webmaster
webmaster@fthrw.com

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #26 on: December 08, 2005, 12:47:27 AM »
Cathy, firstly ... please read Step #1 under "THE FormMail.pl SCRIPT:" section of the following tutorial:

http://www.lunarforums.com/forum/index.php?topic=18221.0

Once you do what Step #1 says, you will want to check to make sure that your script starts and ends with the exact same lines as shown in the original script (click on the link below to see the original script):

http://nms-cgi.sourceforge.net/formmail_compat-3.14c1/FormMail.pl

Normally, the "Premature end of script headers" error means that the script is missing some code.

If your revised script and the original script do not have the same first line and last lines of the code, then you will need to start over with the original script to make sure you have all the coding.

You only changed the USER CONFIGURATION SECTION of the script, right? You didn't touch any other areas of the code below that? If you did, you need to start over with the original script.

Offline fthrw

  • Newbie
  • *
  • Posts: 3
Re: Can't quite figure out Form Mail... Help?
« Reply #27 on: December 08, 2005, 06:58:36 AM »
Hi again,

Okay, I was a knucklehead and forgot to change the script name form FormMail. Did that. Now it's called NewHandler.pl, it's in the cgi-bin directory. I double checked that it was set to 755 and used the cPanel to makes sure it uploaded as ASCII and double checked it was readable on the screen. Still not working. I SWEAR TO GOD I didn't touch anything in the script except the configuration lines for hostname etc. as specified in your steps. I double checked that the script begins and ends like the one you sent me the link to (because I also thought that error meant the script had been truncated). I even double checked that the line breaks were UNIX incase that was causing a problem, but they seem fine.

In my desperation :-) I went to a Perl site to look up the infamous "Premature end of script headers" error and they suggested putting in a line beneath the perl directory that would show you in the browser where the error is happening. (use CGI::Carp qw(fatalsToBrowser);). I did that and the error I get now is:

Software error:
Can't find string terminator "END_INLINED_CGI_NMS_Script" anywhere before EOF at NewHandler.pl line 1032.

I don't understand how this can be if I haven't touched anything in the script, just uploaded it as it was from place LunarPages sent me to download it.

Line 1032 is in the middle of the script:

unless (eval {local $SIG{__DIE__} ; require CGI::NMS::Script}) {
  eval <<'END_INLINED_CGI_NMS_Script' or die $@;       ===========> LINE 1032
package CGI::NMS::Script;

Any ideas?

THANK YOU!

Cathy

leighsww

  • Guest
Re: Can't quite figure out Form Mail... Help?
« Reply #28 on: December 08, 2005, 09:07:26 AM »
Hi  :)

Okay, next thing to do is to remove this from your HTML form page (located under your other hidden tags right after the action tag):

Quote
<!--contest@fthrw.com, treasurer@fthrw.com, join@fthrw.com -->
<!--<input type="hidden" name="recipient" border="0" value="webmaster@fthrw.com"> -->

You don't want to have those showing in the html due to spam bot email harvesting.

Then take the original NMS FormMail script and just redo it and upload a new one, since the code from your previous one may be corrupted and you don't want to be trying to mess with finding where. It'll just be easier and faster to start over.

If that STILL doesn't do it, then PM (Private Message) me your username and password to login to your server and I will take a look. You can change your password when I am done.

Offline fthrw

  • Newbie
  • *
  • Posts: 3
Re: Can't quite figure out Form Mail... Help?
« Reply #29 on: December 08, 2005, 01:42:35 PM »
Thank you, Leigh! :yey: That was the problem. Something in the file had gotten corrupted. My husband looked through it and found a chunk in the middle that looked like all the carriage returns had been stripped and it was all globbed together so badly he couldn't make heads or tales out of what should be on what line. No idea how that would've happened. So I went back to the site and got a new copy of the script and now it works like a dream. Glad to know I wasn't simply going insane...had my doubts there for a minute. :-)

Now I just have to go back to support and find out why none of our domain email addresses work anymore. Fix one thing and it leads you to another problem...

Thanks for all your help. You're a godsend. :love:

Cathy   :D