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

Help With form2email

Started by form2email, November 20, 2013, 02:51:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

form2email

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
 

Dynaweb

Looks like you have the fields "firstname" and "surname".  Make sure those are reflected in your php script.  If you still have trouble, post the php script here and I can review it.

form2email

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;
##################################################################################

Dynaweb

Oh, that is a perl script.  I stopped using perl many years ago in favor of PHP which is more easily configurable and cross-server compatible.

Here is a good php form-to-email script that comes with instructions.
http://www.dynawebdesigns.com/scripts.htm

form2email

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

Dynaweb

That could be achieved by using either a separate web page before the main form OR by using javascript.  I do not know of any pre-fabricated script that will do that easily, but if you want I can customize the script for a nominal charge.