News:

Go to HostNed.com
Welcome.  This is a place to get user-to-user support, learn more, and share ideas.  If you can't find your answers here, feel free to ask by creating a new topic or visit the support ticket system at https://my.hostned.com :)  Have fun here!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - form2email

#1
Scripting / Re: Help With form2email
November 21, 2013, 02:57:15 PM
Hi Dynaweb,
Thanks for this suggestion, will look into it.

Ideally I would like a form which starts with the client's details but if they click no on 'are you the student' then another part of the form opens asking for the student's details.

Is this easy to do or am I better to stay with what I've got?

www.norfolktutors.co.uk/newenquirypage.html


Many thanks
NT
#2
Scripting / Re: Help With form2email
November 21, 2013, 10:15:46 AM
Hi,
Thank you for this advice, I have put in the script the same form names as in the form.

I also want to make the form compatible with android, windows & apple products.

Many thanks
Here is my script.

sr/bin/perl
##################################################################################
# Form2Email.net 27/November/2006
# © 1999-2005 Form2Email.net
##################################################################################
# Instructions:              http://www.Form2Email.net/instructions/
# FAQ:                       http://www.Form2Email.net/faq/
##################################################################################
my $script_name              = 'form2email.pl';
my $HTML_thankyou            = 'http://www.norfolktutors.co.uk/thankyou.html';
my $to                       = 'hostmaster@ntl.com';
my $from                     = 'enquiry@norfolktutors.co.uk';
my $mailprog                 = '/usr/bin/mail';
my $subject                  = 'Web Enquiry from www.norfolktutors.co.uk';
##################################################################################
#
#          That's everything you need to get your script running!
#                You don't need to change anything else
#      unless you want to use any of the advanced features of the script
#
##################################################################################
# Advanced Settings Log details
my $log                      = 0;
my $log_name                 = 'log.txt';
my $seperator                =  '##### log #####';
my $data_only                = 0;
##################################################################################
# Admin mode
my $admin_mode               = 'admin';
my $username                 = "username";
my $password                 = "password";
##################################################################################
# Advanced Settings
my $kill_image_buttons_value = 1;
my $kill_html_tags        = 1;
my $subject_field            = "";
my $max_message_length        = 1000;
my $max_message_error        = "Your message is too big";
my $send_just_data           = 0;
##################################################################################
# Advanced Settings From Field Name
my $from_field_name          = 'Email';
my $from_field_name_error    = "Data Error in $from_field_name";
##################################################################################
# Advanced Settings Auto Responder
my $auto_responder           = 0;
my $auto_responder_from      = 'email@your-website-url.co.uk';
my $auto_responder_message   = "responder.txt";
my $auto_responder_subject   = "Email from your-website-url.co.uk";
##################################################################################
# Advanced Settings Environmental values
my $REMOTE_ADDR              = 1;
my $HTTP_USER_AGENT          = 1;
my $DATE                     = 1;
##################################################################################
# Advanced Settings SMTP email
# use Net::SMTP;
my $send_via_SMTP            = 0;
my $mailhost                 = 'smtp.com';
##################################################################################
# Advanced Settings required fields
my $required_fields_form     = 1;
my @required_fields          = (firstname,secondname,homeaddress,postcode,subjectrequired,natureofhelp);
my @required_fields_numbers  = (landlinenumber);
my @required_fields_email    = (email);
my $error_fields_require     = "Field is blank, it is required";
my $error_fields_numbers     = "Only numbers";
my $error_fields_email       = "Email address is not valid";
my $error_fields_forbidden   = "Forbidden field name";
my $error_title              = "Sorry, we need you to check the following";
my $fontColor                = "black";
my $fontSize                 = 3;
my $fontFace                 = "Verdana";
my $return_message           = "Please click 'back' on your browser and try again";
##################################################################################
# Advanced Settings extra thank you page
$HTML_thankyou_field_name = 'ThankYouPage';
$ThankYou{'thankyou1'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou2'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou3'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou4'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou5'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou6'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou7'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou8'}       = 'http://www.your-website-url.co.uk/';
$ThankYou{'thankyou9'}       = 'http://www.your-website-url.co.uk/';
##################################################################################
# Advanced Settings extra email address
$field_name_email = 'SendToAddress';
$SendTo{'email1'}            = 'email@your-website-url.co.uk';
$SendTo{'email2'}            = 'email@your-website-url.co.uk';
$SendTo{'email3'}            = 'email@your-website-url.co.uk';
$SendTo{'email4'}            = 'email@your-website-url.co.uk';
$SendTo{'email5'}            = 'email@your-website-url.co.uk';
$SendTo{'email6'}            = 'email@your-website-url.co.uk';
$SendTo{'email7'}            = 'email@your-website-url.co.uk';
$SendTo{'email8'}            = 'email@your-website-url.co.uk';
$SendTo{'email9'}            = 'email@your-website-url.co.uk';
##################################################################################
# Advanced Settings file upload
my @file_upload_fields       = ();
my $rename_file              = 0;
my $max_size                 = 100000;
my @required_file_types      = ("txt", "jpg", "jpeg", "tif", "gif");
my $error_max_size           = "Your file is too big!";
my $error_file_type          = "File type is not valid!";
my $file_dir                 = "/path/to/your/directory";
my $file_URL                 = "http://www.your-website-url.co.uk/files";
my $useKb                    = 0;
##################################################################################
#3
Scripting / Help With form2email
November 20, 2013, 04:51:20 PM
I am using form2email for my clients to contact me about obtaining a tutor.

I am using DW8, when I viewed it on firefox and clicked 'submit' I got the script page [I believe this means the form has been submitted.  However, I don't think the required fields have been recognised and are therefore ignored when on the server.  The thank you page does not work. 
I have stipulated in the script which fields I want as required.

Question:  should I stipulate in the script which fields I want or in the html form?

If in the form, this is how one of the fields look:     
  <tr>
     <td align="right" class="style8">*Your first name:&nbsp;</td>
<td align="left" valign="middle" width="497"> <input type="text" name="firstname" size="26" maxlength="60" class="required" /> </td></tr>
   
  <tr>
    <td align="right" class="style8">*Your surname:&nbsp;</td>
  <td align="left" valign="middle" width="497"><input type="text" name="surname" size="26" maxlength="60"  class="required"/>  </td></tr>

How this makes sense.

NT