Current location: Hot Scripts Forums » Programming Languages » Perl » multiple forms accessing formmail.pl

multiple forms accessing formmail.pl

Reply
  #1 (permalink)  
Old 05-27-09, 09:58 PM
kipaqra kipaqra is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
multiple forms accessing formmail.pl

I have two forms on my website with different firld names accessing the same formmail.pl script.
One form works perfertly but the other does not work.

I have set both form headers to the same configuration ie.
HTML Code:
<form action="/cgi-bin/formmail.pl" method="POST">
        <input type="hidden" name="recipient" value="webmaster@elizabeth-lewis.co.uk"/>
        <input type="hidden" name="subject" value="Website Information Request"/>
        <input type="hidden" name="required" value="name,email"/>
        <input type="hidden" name="redirect" value="../thankyou.html"/>
the second form dows not redirect or send the email.

Any ides why?

Last edited by Nico; 05-29-09 at 06:52 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-29-09, 06:53 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,508
Thanks: 3
Thanked 11 Times in 11 Posts
Can you post both HTML forms, and the formmail script?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-15-09, 02:36 PM
mjoyce71 mjoyce71 is offline
New Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
I would take the non-working form and work backwards towards the working one - Meaning I'd first make the fields the same and test, etc.. To find out what's broken. FYI - I use these guys FormMail Hosting - Web Form to Email Processing - The really nice thing about them is they'll help you with your code until it works - Meaning if you just sign up with them they'll fix it for you.

Mark.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-29-09, 06:26 PM
Boraan's Avatar
Boraan Boraan is offline
Coding Addict
 
Join Date: Jul 2007
Location: Clayton, NC
Posts: 278
Thanks: 0
Thanked 0 Times in 0 Posts
When using perl it's best to let the script do the work. I'd take your form and get rid of the extra hidden values. If the script is failing it will most likely be a syntax error. In order to filter that out try letting perl do the job it was meant too
Code:
<form action="/cgi-bin/formmail.pl" method="POST">
<input type="text" name="recipient" value="">
<input type="text" name="subject" value="">
Next let perl handle all of the data.
Code:
#!/usr/bin/perl
use strict;

print "Content-type: text/html\n\n";

my($recipient) = "$FORM{recipient}";
my($subject) = "$FORM{subject}:'

# Check to see that all fields are filled out.
my(@required) = ("$recipient", "$subject");
foreach my $i(@required) {
if ($i eq "") {
print "You must fill in $i. Press back in your browser to try again.";
exit;
}

# Handle data if passed.
my($redirect) = "thankyou.html";

print redirect('$redirect');
Once your post information is good to post the information where you want it to go, perl will handle everything in between. Once the data matches on both forms they will work. character like @, if they aren't handled correctly will usually kick a syntax error, which is why we let perl handle them.
__________________
Dexter Nelson
Techdex Development & Solutions
========================
Message Me (username: echomusic)
Hotscripts Softpedia
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple forms dami PHP 1 12-26-08 02:35 PM
[SOLVED] multiple forms in a single page id10tn00b HTML/XHTML/XML 2 10-09-08 12:26 AM
Accessing Forms Which have no FORMS set desdev JavaScript 2 09-08-07 08:44 PM
Databases and multiple forms JagerKatze Windows .NET Programming 0 10-12-04 10:58 PM
Multiple forms to email and db radarman012000 ASP 0 08-08-04 09:28 PM


All times are GMT -5. The time now is 08:26 PM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.