[pmwiki-users] Using mailform2 with multiple forms on a single site

Benoît DUTILLEUL benoit.dutilleul at googlemail.com
Sat Jan 6 18:13:57 CST 2007


Dear all,

I've been trying to use the recipe mailform2 to send to an email address the
data collected from 2 forms on a single website. Here is the piece of code I
am using and that I can't get to work:

include_once("$FarmD/cookbook/mailform2.php");
#
#Application form
if ($pagename == 'Main.ApplyForPosition') {
$Mailform2Subject='New volunteer candidate';
$Mailform2SuccessPage='Main.SuccessfulVolunteerRegistration';
$Mailform2FailurePage='Main.VolunteerRegistrationFailure';
$Mailform2Recipient='me at mydomain.com';
$Mailform2Text = "First name:" . $_POST['first_name'] . "Last name:" .
$_POST['last_name'] ;
#
#Subscription to the newsletter
} else {
$Mailform2Subject='New subscription';
$Mailform2SuccessPage='Main.SuccessfulRegistration';
$Mailform2FailurePage='Main.RegistrationFailure';
$Mailform2Recipient='me at mydomain.com';
$Mailform2Text = $_POST['username'] . ": " . $_POST['email'] . $FullName;
}

The script does not work because even if I am on the page
Main.ApplyForPosition, it goes in the "else".

Can you help me to find the problem?
Kind regards,

Benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20070107/8159d2c1/attachment.html 


More information about the pmwiki-users mailing list