Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Support > php issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-22-2007, 08:38 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default formmail.php

I can't figure out whats wrong here. I'm using formmail.php and a simple contact form. I can test it and it directs me to the default formmail.php page saying that the email was sent.

Here are my issues. I'm not receiving the emails and the form is supposed to redirect me to a custom thank_you.htm page.

This is a server I just recently got and I never had these issues before, so i am completely clueless how to fix this.
Reply With Quote
  #2 (permalink)  
Old 03-22-2007, 10:24 PM
Administrator
 
Join Date: Mar 2006
Posts: 1,702
Default

May I know the IP address of your server ?
__________________
Web Hosting UK - ASP MSSQL Hosting - cPanel Linux Hosting
AIM : webredback || msn : andrew @ webhosting.uk.com
Toll Free : 0808 262 0855
Reply With Quote
  #3 (permalink)  
Old 03-23-2007, 03:54 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

what about matt's formmail (perl) I haven't used it before, would i be able to switch to it without any issues? do i need to run it on the server as .pl or as .cgi? I'm kinda confused about where to put it also, does it go in the cgi-bin?
Reply With Quote
  #4 (permalink)  
Old 03-23-2007, 10:27 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi, I used to use Matt's formmail, yes it goes in the cgi-bin with the ext .pl

If you have any problems with it change ext to .cgi

Should work without any problems as long as you replace the relevant details on the form (like the email addy to return the form to)
Reply With Quote
  #5 (permalink)  
Old 03-23-2007, 11:23 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

I think that may be another issue of mine.
The .htm page that the form is on doesn't not contain the recipient email address, I'm using the formmail script to do that and the subject line. The only thing in the form itself is the redirect and the appropriate fields.

Does matt's formmail send emails as they were sent from the form submitter? I'll try get it up and running this weekend and see if I can get it working.

Thanks for the input!
Reply With Quote
  #6 (permalink)  
Old 03-24-2007, 03:42 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

As far as I remember, yes the recipient addy is set in the formmail file.
The email you receive is a basic email, with textbox name followed by the users input.

I don't think you will have any problems with it, give it a go.
I think I remember that you also need to set the web addy of the site that is allowed to use the formmail.pl. I can't remember if it is compulsary but it is good practice to add the addy, as it helps stop spammers using your formmail script without your knowledge.
Reply With Quote
  #7 (permalink)  
Old 03-29-2007, 09:40 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

An error has occurred! Error code 500.
Internal Server Error!

I get this same result running it as .cgi or .pl how can I find out what is causing this error?
Reply With Quote
  #8 (permalink)  
Old 04-01-2007, 04:24 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi, I think you probably need to set the write permissions on the file, chmod the file to 757 and see if it cures the problem
Reply With Quote
  #9 (permalink)  
Old 04-10-2007, 11:13 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

Same Error. I've never felt so stupid or incompetent. I'm tired of trying but I have to find some way to get this to work.
Reply With Quote
  #10 (permalink)  
Old 04-11-2007, 10:52 AM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Hi,
if you problem isn't related to permissions then I can only see that you have a problem with:

PHP Code:
The action of your form needs to point towards this script (obviously), and 
the method must be POST or GET in capital letters.  Version 1.5 of FormMail 
offers many 
new ways to code your form to tailor the resulting HTML page 
and the way the script performs.  Below is a list of form fields you can 
use and how to implement them.

Necessary Form Fields:
======================

There is only one form field that you must have in your form, for 
FormMail to work correctly.  This is the recipient field.

Field:       recipient

Description
This form field allows you to specify to whom you wish for your
             form results to be mailed
.  Most likely you will want to
             configure this option 
as a hidden form field with a value equal
             to that of your e
-mail address
             As 
of version 1.8You can include multiple recipients by 
             separating the values with commas


Syntax:
             <
input type=hidden name="recipient" value="email@your.host.com">
             OR  <
input type=hidden name="recipient" 
                                
value="user@yourhost.com,user2@yourhost.com"
What sort of form variables are you trying to send, is it a basic form?

Have you also tried changing the extention to .cgi ?

As mentioned, I recall having this problem originally, and it was due to permissions and the fact that I hadn't followed the instructions above correctly.
Reply With Quote
  #11 (permalink)  
Old 04-17-2007, 07:26 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

My form is just a basic contact form.
HTML Code:
<form action="cgi-bin/FormMail.pl" method="POST" enctype="multipart/form-data" name="mydomain_contact" id="mydomain_contact">
<input type="hidden" value="http://www.mydomain.com/thank_you.htm" name="redirect" id="redirect">
<input type="hidden" value="*mydomain.com Contact Form*" name="subject">
<input type="hidden" name="require" value="email,phone_no">
<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
<input type="hidden" name="recipient" value="me@mydomain.com">

<input name="name" type="text">
<input name="email" type="text">
<input name="phone_no" type="text">
<textarea name="textarea"  cols="10" rows="10" style="width:180px; height:95px; overflow:auto"></textarea>

<input name="Submit" type="submit" id="Submit" value="Submit">

Last edited by v3locity; 04-17-2007 at 07:48 PM.
Reply With Quote
  #12 (permalink)  
Old 04-17-2007, 08:17 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

and I take it that your form is in the root of your public_html folder?

If so and you chmod to 777 (from 757) then I can't understand why you have a problem. Your form seems fine and you have the recipients hidden field.
Reply With Quote
  #13 (permalink)  
Old 04-17-2007, 08:47 PM
Junior Member
 
Join Date: Mar 2007
Posts: 19
Default

I just set formmail.pl and .cgi as chmod 777 just to see I set the form as 777 as well. same problem.

However, I did some digging and I think the error may be in formmail.pl
[Tue Apr 17 11:23:22 2007] [error] [client 65.23.106.241] Premature end of script headers: /home/escortca/public_html/cgi-bin/FormMail.pl

since i changed it to 777 it also says that it is writable, i guess i can fix that by changing it back to 757.

I just checked the script, its the same as the copy of formmail.pl i downloaded.

Last edited by v3locity; 04-17-2007 at 08:55 PM.
Reply With Quote
  #14 (permalink)  
Old 04-17-2007, 08:58 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

ah, what's at the top of the formmail script?
#!/usr/bin/perl
print "Content-type: text/plain\n\n";

if not try above.

Also chmod cgi-bin and formail.pl to 755 and try that.

good luck


ps...sorry, i didn' realise that these days setting permissions to 777 can cause some browsers to reject the request

Last edited by jon123; 04-17-2007 at 09:03 PM.
Reply With Quote
  #15 (permalink)  
Old 04-17-2007, 09:09 PM
Senior Member
 
Join Date: Jan 2007
Posts: 939
Default

Also note:

script has to be uploaded in ascii mode although most ftp clients do this automatically.

if above doesn't work you will need to test that the path to perl is correct.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:15 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum