 |

06-15-2004, 07:32 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
CGI Script Feedback form
Hi all,
Have set up a feedback form in my website http://www.cubid.co.uk/contact.htm
though I am having trouble writing or getting a script to send it my server and then back to me.
I understand that the best method is to use CGI scripting (have located the bin etc on my server) though am having trouble setting one up for my forms.
Can anyone help? or offer some scripting for my page? http://www.cubid.co.uk/contact.htm
Cheers
Dan
|

06-15-2004, 08:23 AM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: UK
Posts: 83
|
|
dan_bradshaw,
it appears that the file you are referencing does not exist
try this...
http://www.cubid.co.uk/cgi-bin/mylog.cgi
as the path to the cgi file
remember the root of the website is the www not root of the file system
MM
|

06-15-2004, 08:55 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
Thanks for this, will have a go at that. Do you mean the link from my submit button?
Thanks for your help
|

06-15-2004, 10:42 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
Have tried this though am now getting the internal message error...do you think it maybe my script that is causing the problem?
Are you able to view the script for me?
Thanks
Dan
|

06-15-2004, 12:30 PM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: UK
Posts: 83
|
|
dan_bradshaw,
Sorry i no v.little about cgi itself but you may want to check that there are execute permissions on that folder etc as this could be causing this.
MM
|

06-16-2004, 09:34 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
Forms, CGI, perl...Arrrghh
Hi all,
I am having real trouble with my forms and script to process them.
All that keeps coming up is
500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, info@cubid.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Is anyone able to help me?
I can them the script and other details if necessary
Cheers
Dan
|

06-16-2004, 10:38 AM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
|
|
Try removing the second "form" from the following line
<form action="http://www.cubid.co.uk/cgi-bin/formmail.pl" form method=post name=form1>
Joe
|

06-16-2004, 10:47 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
I have replaced the form with a much simpler form and made sure that I have not got any extra formsin now. The dam thing still doesn't work...grrr
I don't think it could be related, but the e-mail address I have got the script forwarding to is one which has a auto responder, could this be affecting it?
|

06-16-2004, 01:26 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Mar 2004
Location: Switzerland
Posts: 345
|
|
I cannot give a precise solution, but it could be a problem related to permissions of the perl files.
Otherwise it could be that the path to perl is not correct.
|

06-16-2004, 04:58 PM
|
|
WebProWorld New Member
|
|
Join Date: Dec 2003
Location: Canada
Posts: 2
|
|
Your sever should have a good help desk. Someone there should be able to point you in the right direction.
Quote:
|
Originally Posted by xmx
I cannot give a precise solution, but it could be a problem related to permissions of the perl files.
Otherwise it could be that the path to perl is not correct.
|
|

06-16-2004, 05:48 PM
|
![G[dot]com's Avatar](http://www.webproworld.com/avatars/g-dot-com.gif?dateline=1205188495) |
WebProWorld Veteran
|
|
Join Date: Mar 2004
Location: Buenos Aires - Argentina
Posts: 304
|
|
Dan, Hi!
As Zelo mention this is something that the people of the hosting in which you have your site MUST help you with.
Moreover, before you do anything on your own and waste time and stress yourself out, it is convenient that you contact the help desk and ask as a 2 year-old boy:
"Hi I have to add some forms to in my site. Which aplications do you use to process the scripts? And do you have templates to send to me so I customize them with my needs?"
They have to help you, and they will give you excactly the information you need for your site. No one will know better than them.
Hope I am helping you with this, kiss,
Gi
|

06-16-2004, 05:50 PM
|
|
WebProWorld Pro
|
|
Join Date: Oct 2003
Location: Phoenix, AZ
Posts: 183
|
|
Test permission, upload type
The error you're receiving is generally caused by one of the following...
1) The file permissions of your formmail.pl file are not correct. They should be set to "755" in order to properly run the script.
2) The file was not uploaded using Auto-ASCII or ASCII. If you upload the file in "binary" mode, it will not work properly.
3) The first line in the formmail.pl file is not the correct path to perl. (ie: #!/usr/bin/perl). The default path is not always right. You should check with your host for the correct path.
I'm pretty confident that this information will help you get the form working properly.
|

06-16-2004, 07:41 PM
|
|
WebProWorld New Member
|
|
Join Date: Mar 2004
Location: Berkeley
Posts: 4
|
|
My PERL form fix
Hi,
I had the same problem . I re-checked the "755" rule, ascii only upload, correct file location (BTW, After I started using CuteFTP , the EXACT location of server files became more clear. Dreamweaver befuddled things a bit)
I was still getting errors...
Anyhoo, I edited the actual mailform.pl file and deleted the "@referer" section. About 15 lines of code.
This did the trick for me.
Now... I would love it if someone could explain the finer points of ordering the data!! I have 15 "inputs" in a logical order on my form(name, address, coutry, phone, etc...), when the data is parsed and emailed, it seems to be in a random order in the resulting email.
Thanks and good luck!
|

06-16-2004, 07:46 PM
|
|
WebProWorld New Member
|
|
Join Date: Mar 2004
Posts: 5
|
|
For scripts r a pain!
I agree with chowell...
Personally I ditched this method a few years ago, mainly because of the security holes associated with cgi mail scripts like formmail, also because you can't do stuff like send html mail.
Have you tried using the php mail function? Its far more flexible... here's an example script
<?php
// Ken McCormack / P21
$recipient = "recipient@domain.com.au";
// do not pass email recipient from form!!
$recipient_name = "Fred Smith";
if ($submit) {
// if form has been submitted, send mail
$name = $_POST['firstName'] ." " . $_POST['lastName'];
$text = $_POST['message'] . date("jS F Y G:i:s");
$redirect = $_POST['redirect'];
$email = $_POST['Email']; // sender's email
$head = "MIME-Version: 1.0\r\n";
$head .= "Content-type: text/plain\r\n";
// or for html formatting
// $head .= "Content-type: text/html; charset=iso-8859-1\r\n"; // for html mail
$head .= "From: " . $name . " <" . $email . ">\r\n";
$head .= "To: " . $recipient_name . " <" . $recipient . ">\r\n";
$head .= "Reply-To: ". $name . " <". $email .">\r\n";
$head .= "X-Priority: 2\r\n";
$head .= "X-MSMail-Priority: Normal\r\n";
$head .= "X-Mailer: PHP";
$subject = "Site Name Website Enquiry - " . $fullname;
mail($recipient, $subject, $text, $head);
// redirect to next page
header('Location: ' . $redirect); /* Redirect browser */
exit;
} // end if
?>
That's all there is to it! If you're not conversant with Perl, PHP mail is a much more user friendly means to control mail from web forms.
|

06-16-2004, 07:58 PM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: UK
Posts: 2,803
|
|
If it's just HTML formatted emails you're after, PHP is certainly not the only alternative.. most mailer scripts have some means of formatting the email that is sent.
I've used a variety of Perl, CGI and ASP scripts that have ALL offered the possibility of HTML emails... IMO the choice of scripting language is immaterial... as has been suggested earlier Dan, check with your hosting support first.. they may have ready-made solutions for you. If that doesn't help, feel free to send me the script and I'll help in any way I can.
Paul
|

06-16-2004, 10:59 PM
|
|
WebProWorld New Member
|
|
Join Date: Mar 2004
Posts: 5
|
|
I give up, make a suggestion and you get a response like that. What a waste of time. Time to unsubscribe.
|

06-16-2004, 11:21 PM
|
![G[dot]com's Avatar](http://www.webproworld.com/avatars/g-dot-com.gif?dateline=1205188495) |
WebProWorld Veteran
|
|
Join Date: Mar 2004
Location: Buenos Aires - Argentina
Posts: 304
|
|
kenmcc,
You are *very* welcome TO leaving.
Actually I´d like to see no more people here being agressive or critizizing other´s posts and help.
So, please, Kenmcc, unsubscribe the sooner.
And if you know some one else that thinks like you about this forum, it would be great if they join you.
:o)
Gisela
|

06-17-2004, 01:58 AM
|
|
WebProWorld Veteran
|
|
Join Date: Apr 2004
Posts: 453
|
|
Geez, quit helping people Paul.
ken, the real point is that the poor guy can't run CGI scripts. That's not useful. He should check with his host and get the paths straightened out.
And while I agree that formmail.pl is notorious for being spam bait, it is certainly possible to write a secure perl script. And an insecure PHP script.
|

06-17-2004, 03:53 AM
|
|
WebProWorld New Member
|
|
Join Date: Jun 2004
Posts: 1
|
|
cgi problem
You will also get this error if you do not put an escape character in the email address in the scritp.
you\@you.com
|

06-17-2004, 05:48 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
Hi,
Thanks for all your comments and suggestions, I will check them all out this morning... I have been on to the hosts who seem to be sorting things out, or at least looking into it.
Not sure what kenmcc was on about...
PHP does sound more user friendly, though I will also go back and check the code.
Have many other people used the formmail from scriptarchives.com? It seems pretty straight forward, only having to change a couple lines of code...however things are never as easy as they seem.
Thanks
Hope you are all routing for England lads today.
Dan
Cubid Imagery...Innovative Solutions and Creative Web Designs...when it works
www.cubid.co.uk
info@cubid.co.uk
|

06-17-2004, 06:18 AM
|
![G[dot]com's Avatar](http://www.webproworld.com/avatars/g-dot-com.gif?dateline=1205188495) |
WebProWorld Veteran
|
|
Join Date: Mar 2004
Location: Buenos Aires - Argentina
Posts: 304
|
|
Hope your hosts help you to get a definite solution, Dan.
I bet they will be able to. They are used to deal with these script´s *inconveniences*
And thank you for your thanks :o)
Kiss
Gi
BTW eventhough I am used to ASP because of my hosting services which run under Windows NT platforms (ASP friendly), I found that PHP is really simple.
Seems that the creators of PHP have clearer minds and more common sense than other language programmers :oP
|

06-17-2004, 06:38 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: UK
Posts: 2,803
|
|
Quote:
|
Originally Posted by kenmcc
I give up, make a suggestion and you get a response like that. What a waste of time. Time to unsubscribe.
|
What can I say? My reply was contributing to the general discussion, there was no intention to demean your suggestion Ken. As Gisela says, PHP can offer very neat and user-friendly code, I have no doubt of that fact.
Dan's problem is mostly concerned with his CGI/Perl script, and I was offering to help if he got no joy from his hosting support.
Quote:
|
Originally Posted by dan_bradshaw
Hope you are all routing for England lads today.
|
Most certainly will be! 17:00 GMT kickoff.. come on you England!! :o)
Good luck with your script Dan, post back if you have any further problems.
|

06-17-2004, 08:16 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
Cheers again and thanks g[dot]com for your thanks and the little kiss. ;-D
|

06-17-2004, 08:27 AM
|
|
WebProWorld Pro
|
|
Join Date: Jan 2004
Location: London
Posts: 146
|
|
<?php
// Is this the heading?
$recipient = "info@cubid.co.uk";
// do not pass email recipient from form!!
$recipient_name = "Cubid Imagery";
if ($submit) {
// if form has been submitted, send mail
$name = $_POST['firstName'] ." " . $_POST['lastName'];
$text = $_POST['message'] . date("jS F Y G:i:s");
$redirect = $_POST['redirect'];
$email = $_POST['Email']; // sender's email
$head = "MIME-Version: 1.0\r\n";
$head .= "Content-type: text/plain\r\n";
// or for html formatting
// $head .= "Content-type: text/html; charset=iso-8859-1\r\n"; // for html mail
$head .= "From: " . $name . " <" . $email . ">\r\n";
$head .= "To: " . $recipient_name . " <" . $recipient . ">\r\n";
$head .= "Reply-To: ". $name . " <". $email .">\r\n";
$head .= "X-Priority: 2\r\n";
$head .= "X-MSMail-Priority: Normal\r\n";
$head .= "X-Mailer: PHP";
$subject = "Site Name Website Enquiry - " . $fullname;
mail($recipi | |