asp and php · version 1.0 asp and php setup manual 44, ambazari layout, nagpur, mh, india –...

50
Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838 Email : [email protected] Website : http://www.infosys.kkeindia.com

Upload: others

Post on 06-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Version 1.0

ASP and PHP Setup Manual

44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Email : [email protected] Website : http://www.infosys.kkeindia.com

Page 2: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Contents CHAPTER 1 USING THIS HELP............................2 Text Conventions....................................3 Special Messages ...................................4 Locating Help ..........................................5 CHAPTER 2 ABOUT KMITA MAIL ........................6 Features ...................................................7 System Requirements ............................9 Contents of ZIP file ...............................10 How Kmita Mail Works? .......................11 CHAPTER 3 GETTING STARTED .......................12 PHP or ASP , Sendmail or SMTP, CDO or CDONTS ?.........................................13 Uploading to the Server .......................14 Setting Folder Permissions .................17 CHAPTER 4 AUTOMATIC SETUP UTILITY (ASU).........................................................20 Setup.php , Setup.asp ..........................21 Actions Performed by ASU..................27 Modifying Form Configuration Files...28 CHAPTER 5 BUILDING HTML FORM .................31 Essentials in HTML Form.....................32 Field Names Formatting.......................33 CHAPTER 6 ADVANCED KMITA MAIL FUNCTIONS ....................................34 Conditional Form Submission ............35 Kmita Mail as Download Manager.......39 Multi-page forms using Kmita Mail .....40 Sequence of Fields in Data Email .......42 CHAPTER 7 FORM VALIDATION........................43

CHAPTER 8 GLOSSARY .....................................45 CHAPTER 9 INDEX ..............................................47

Page 3: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Using This Help - 2

Chapter 1 Using This Help

Page 4: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Using This Help - 3

Thank you for buying Kmita Mail for your website forms. Please take a moment to familiarize yourself with the special text and messages used throughout this guide. Text Conventions The examples below explain the specially formatted text used in this guide.

HTML code appears in Green coloured Text : <FROM method=”post” action=””>

The names of the input form tags appear in Bold Type : formname, Email

PHP code appears in Brown coloured Text : <? $to = [email protected]; ?>

ASP code appears in Orange coloured Text : <% tto = “[email protected]” %>

File names appear in Italics Text : setup.php , setup.asp

URL appear in Bold Blue text : http://www.kmita-mail.com

Email address appears in Blue text : [email protected]

Page 5: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Using This Help - 4

Special Messages

The following words and symbols have special meaning in this guide.

Note : Important information concerning the operation of Kmita Mail

Caution : Failure to follow directions may result in malfunctioning and data loss.

// Error : Failure to follow directions could lead to the errors listed in this box.

Page 6: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Using This Help - 5

Locating Help

Kmita Mail provides you with several ways to find help.

1. Setup Manual

2. Glossary

3. Index

4. Website Support : http://www.support.kmita-mail.com/

5. Email Support : [email protected]

Note : Always mention Location of Kmita Mail on your server and the form you are trying to integrate with Kmita Mail when communicating with Support.

Page 7: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 6

Chapter 2 About Kmita Mail

Page 8: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 7

Features

See the unmatched features and functionality provided by Kmita Mail

Available in both PHP and ASP Kmita Mail is available in PHP and ASP formats. Both versions provide you with identical functions... even their file structure is the same. For example, in the PHP version the setup file is 'setup.php'. In ASP it's 'setup.asp'.

"Zero" Installation hassles Kmita Mail includes a setup utility of its own which installs a form with 3 simple steps. No opening script files, no editing required. It's all done quickly by the Automatic Setup Utility.

Kmita Mail handles unlimited forms. Run the form setup utility once before you send the form data and you are done in less than 2 minutes!

Auto responder Send a thank you note to the person who submitted your form. It can even be HTML formatted to include your website / firm logo, advertisements, etc. It can also can be used to send further information or provide password only access to a restricted portion of your site.

To, CC, BCC fields supported Send form data to as many people as you wish. Kmita Mail supports multiple email fields To:, CC: (Carbon Copy) and BCC (Blind Carbon Copy).

Works with any form You can use check boxes, password, radio buttons, pull down menus, text boxes, text area boxes.

Data file Creation Kmita Mail can store all the data submitted through a form into a flat file database. The file can then be easily imported into spread sheet software like MS Excel or databases MS Access or MySQL. It's a great way to capture and store email addresses for later contact.

Success and Error Pages Specify the pages matching your website design where the Kmita Mail should take your visitor once he has submitted the form. A thank you page if the form was filled out correctly. An error page if something was left out.

Free help utility and support KKE provides help and support free of cost. We provide priority support to all our customers.

Installation Request KKE provides one installation free of cost for each license purchased!

Page 9: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 8

Conditional Form Submission Accept data with conditions and send it to different locations according to your requirements. For example Sales, Marketing, Purchase, Customer Care, or Support.

IP to Country Identify the country to which the IP address belongs. An excellent tool in fraud prevention.

SMTP, SendMail, CDONTS, CDOSYS In the PHP version, Kmita Mail can send through Sendmail installed on the server or can send email through a SMTP (Simple Mail Transfer Protocol) server with or without authentication. Using ASP, it can send email through CDONTS and CDOSYS both. Ask us for more information about this if you need clarification.

Download Manager Utility Kmita Mail can function like a download manager on your website. Don't allow a visitor to download a file unless he fills in a simple form. This is a good tool for restricting access to PDF or Image files.

Spam Proof and Hacking Proof Kmita Mail prevents spammers and hackers from viewing submission details. Your email won't be seen by people on the internet. .

Kmita Mail is easily the most flexible and powerful form processing script you can buy. That is why it is the best selling Form processing Script. Best of all its just $20!

Page 10: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 9

System Requirements

Kmita Mail is available in two languages PHP and ASP. PHP

PHP executable requires PHP 4.1.0 or higher installed on the server. Ask your web host if your plan is properly equipped. Send Mail installed or any SMTP server with or without authentication.

ASP

ASP executable requires ASP 3.0 or higher, CDONTS or CDO must be installed on the server. CDO component requires a SMTP server for sending emails. CDONTS was shipped with earlier versions of Windows but now CDONTS has phased out and Windows 2003 ships CDO component instead of CDONTS. Some of the host even today have not upgraded to Windows 2003 and do not support CDO. Kmita Mail provides option for you to install any one depending upon what your host supports. CDONTS can be installed on Windows 2003 , CDONTS.dll can be found in the Service Pack of Windows 2000. Read More at http://www.support.kmita-mail.com/resources/CDONTS.kke

The components used by Kmita Mail are available on approximately 98% of all web hosts. Both scripts, ASP and PHP are provided with one license, you can use any one of them, whichever suits your server best. Generally, UNIX servers can process PHP very easily whereas cannot process ASP scripts. While, some Windows hosting companies do offer PHP execution but Windows is friendlier to ASP rather than PHP.

Page 11: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 10

Contents of ZIP file

Kmita Mail ZIP which you downloaded from the website contains following folders and files.

Name Type Description Kmita CDO Folder ASP CDOSYS version Kmita CDONTS Folder ASP CDONTS version Kmita Sendmail Folder PHP Sendmail version Kmita SMTP Folder PHP SMTP version License.doc File End User License Agreement.

Page 12: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

About Kmita Mail - 11

How Kmita Mail Works?

Forms submitting data to Kmita Mail contain a hidden field called formname which tells Kmita Mail which configuration file to execute. The configuration file stores your Email, Autoresponder text , Success and Error URL .

Page 13: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 12

Chapter 3 Getting Started

Page 14: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 13

PHP or ASP , Sendmail or SMTP, CDO or CDONTS ?

Follow the step by step questionnaire which will help you decide which Kmita Mail to use.

1. Are you installing Kmita Mail on Linux or UNIX Server? If Yes go to 2, No go to 3

2. Does your Host provide Sendmail for sending emails? If Yes go to A, No go to B

3. Which is the Operating System of your server? if Windows 2003, go to D Windows 2000 or Windows NT , go to C

A B C D Kmita Sendmail Kmita SMTP Kmita CDONTS Kmita CDO

Page 15: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 14

Uploading to the Server

You have downloaded the ZIP file from the payment page and according to the previous topic ( PHP or ASP , Sendmail or SMTP, CDO or CDONTS ? ) , you have decided which version to use. Follow the procedure below.

Note : On UNIX and Linux folder is referred to as “directory” . Since most of the people use Windows as their operating system, we would refer directory as folder in this help document.

Step 1 Unzip the contents of the ZIP on your local hard drive, preferably on your desktop. Step 2 Browse to the script folder and then kmita folder, which you are going to use (CDO, CDONTS, Sendmail, STMP). Create icode.asp or icode.php and paste the code provided to you in the text box (after payment) or in the email you received after payment.

Create icode.asp for ASP version and icode.php for PHP version.

Page 16: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 15

Contd..

Page 17: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 16

Step 3 Now connect to Internet, open your favourite FTP program. Upload the kmita folder to the HTML root of your website. The root may be called as htdocs, httpdocs, wwwroot, www_public, www, etc. Some of the most common FTP programs are CuteFTP, WS_FTP, AceFTP(Freeware),etc. E.g. If you are using Kmita Sendmail , then upload kmita folder in Kmita Sendmail folder.

Page 18: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 17

Setting Folder Permissions

Kmita Mail creates files and folders on your server and requires read , write and execute permissions. Folder Permissions on UNIX and LINUX On UNIX and LINUX folder permission for read, write and execute for everyone is CHMOD 777. ( What is CHMOD?) The image below shows the view of ACE_FTP . Right Click on the “kmita” folder and click properties.

Page 19: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 18

Select all the checkboxes or type CHMOD value directly to 777 and click “OK”.

Notice the change in attributes of the "kmita" directory.

Folder Permissions on Windows On Windows , folder permissions cannot be set through FTP client. Generally, Windows Hosts provide an online utility in the domain administration login for changing permissions. Some hosts like “uplinkearth.com” and many more, do not provide any online utility for changing folder permissions. For changing folder permissions, one has to contact their support people who do it for you. On Windows, the folder permissions have to be set to Owner : Read, Write, Execute Everyone : Read, Write, Execute

Page 20: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Getting Started - 19

Page 21: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 20

Chapter 4 Automatic Setup Utility (ASU)

Page 22: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 21

Setup.php , Setup.asp

Now your files are uploaded on the server, permissions are set, its time to switch to browser. Since we are using Internet Explorer , we would be referring browser as Internet Explorer in this help document. Enter the URL of the setup file ( setup.php or setup.asp) in the address bar of Internet Explorer. You see a form similar to image shown below.

Enter the details requested in the form very carefully.

Page 23: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 22

Setup Form Field Description Name of the Form

Kmita Mail stores the configuration details in a unique configuration file. Enter a form name which matches with the HTML form you are building. Form name can be for example “contact”, “marketing” ,etc.

To Fill the email address where you wish to send the data of the form. In case of multiple email addresses, separate them with a comma ',' sign.

CC Fill the email address where you wish to send the Carbon Copy (CC) of the data submitted through form. If you do not want any CC email address, leave it blank. In case of multiple email addresses, separate them with a comma ',' sign.

BCC Fill the email address where you wish to send the Blind Carbon Copy (BCC) of the data submitted through form. If you do not want any BCC email address, leave it blank. In case of multiple email addresses, separate them with a comma ',' sign.

Subject Fill the text you desire to have as a Subject to the email in which you will receive form data. For Dynamic Subjects see Advanced Kmita Mail Functions

Success URL In this field fill a valid URL of the success page, i.e. the page, the visitor sees when the data has been sent to you. You can give some thank you ! message or providing him an estimated time in which you may contact him, etc.

Page 24: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 23

Error URL In this field fill a valid URL of the error page, i.e. the page, the visitor

sees when the data has not been successfully sent to you. Flat file Database In Kmita Mail the form data which is submitted can be submitted into a

flat file database. The fields are separated by ' | ' sign. The field order is Date, Time, IP Address, followed by the sequence of fields in your HTML document. The flat file can be imported in any database software or worksheet software like MS Access, MS Excel, etc.

Auto Responder Auto responder is an utility which sends an email to the visitor immediately after s/he submits the form. The auto response email can include HTML, images available through HTTP. If you wish to send auto-response, select Yes.

Auto text field Auto responder is an utility which sends an email to the email address which was provided by the visitor. The auto response email can include HTML, images available through HTTP. Put HTML code you wish to send to your visitor.

Auto subject field Auto responder is an utility which sends an email to the visitor immediately after s/he submits the form. Auto-subject is the Subject of the email which is received by the visitor.

SMTP Host ( Only in SMTP and CDO Verion)

Since CDO and SMTP need SMTP server to send email, you need to provide SMTP details once during setting up of first form.

Provide the SMTP Host , E.g. mail.kmita-mail.com, mail.yahoo.com, etc. SMTP Username ( Only in SMTP and CDO Verion)

Today due to SPAMs most of the Host have included authentication on their SMTP Servers. Please provide SMTP username for your host.

Leave Blank if your server does not need authentication.

Page 25: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 24

SMTP Password ( Only in SMTP and CDO Verion)

Provide SMTP Password. Leave Blank if your server does not need authentication.

SMTP Port ( Only in SMTP and CDO Verion)

Provide the Server port through which your SMTP server communicates. Generally , it is 25. If you don’t know leave it as 25 and go ahead. If this fails, then you may contact your host to know if SMTP port is different.

//// UNIX and LINUX

Error : Warning: mkdir(/home/linuxkm/public_html/kmita/data/): Permission denied in /home/linuxkm/public_html/kmita/setup.php on line 25 Warning: fopen(data/test0.auto): failed to open stream: No such file or directory in /home/linuxkm/public_html/kmita/setup.php on line 48 Warning: fwrite(): supplied argument is not a valid stream resource in /home/linuxkm/public_html/kmita/setup.php on line 49

Cause : Folder Permissions not set , see Setting Folder Permissions

Error : Warning: main(icode.php): failed to open stream: No such file or directory in /home/linuxkm/public_html/kmita/setup.php on line 83 Fatal error: main(): Failed opening required 'icode.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/linuxkm/public_html/kmita/setup.php on line 83

Cause : icode.php was not found. Create icode.php and save it in kmita folder. See Uploading to the Server.

Error : SMTP version only Error: Cannot conect to mail.yoursmtpserver.comHELO error: . MAIL FROM error: .

Cause : Your server could not connect to your SMTP host. Remedy : Click Back and see if you provided correct SMTP Host. If you have closed the window in which you opened setup.php, then delete smtp.php

Page 26: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 25

using delete.php and open setup.php again. Now you would see the form fields for SMTP server again..

Error : SMTP version only DATA error: .501 <>: missing or malformed local part DATA(end)error: .503 valid RCPT command must precede DATA QUIT error: .500 unrecognized command DATA error: .550 client. DATA(end)error: .503 valid RCPT command must precede DATA QUIT error: .500 unrecognized command

Cause : Your server requires Authentication and you did not provide username and password. Remedy : Click Back and see if you provided SMTP username. If you have closed the window in which you opened setup.php, then delete smtp.php using delete.php and open setup.php again. Now you would see the form fields for SMTP server again..

Error : SMTP version only AUTH error:.250 HELP AUTHENTIFICATION error : .334 UGFzc3dvcmQ6 MAIL FROM error: .535 Incorrect authentication data DATA error: .501 <>: missing or malformed local part DATA(end)error: .503 valid RCPT command must precede DATA QUIT error: .500 unrecognized command AUTH error:.250 HELP AUTHENTIFICATION error : .334 UGFzc3dvcmQ6 MAIL FROM error: .535 Incorrect authentication data DATA error: .550 client. DATA(end)error: .503 valid RCPT command must precede DATA QUIT error: .500 unrecognized command

Cause : Your server requires Authentication and you did not provide username and password. Remedy : Click Back of Internet Explorer and see if you provided correct SMTP username and password. If you have closed the window in which you opened setup.php, then delete smtp.php using delete.php and open setup.php again. Now you would see the form fields for SMTP server again..

//// Windows Errors :

Active Server Pages error 'ASP 0126' Include file not found /kmita/cdo/setup.asp, line 255 The include file 'icode.asp' was not found.

Cause : icode.asp was not found in kmita folder. Create icode.asp and save it in kmita folder. See Uploading to the Server.

Page 27: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 26

Error :

Microsoft VBScript runtime error '800a0046' Permission denied /kmita/cdo/setup.asp, line 145

Cause : Folder Permissions not set , see Setting Folder Permissions See Setting Folder Permissions

Error : (Kmita CDO only)

Testing CDO error '80040211' /kmita/cdo/setup.asp, line 352

Cause : The SMTP server details you provided were incorrect. Either your SMTP host was not found, or either of your username and password were incorrect.

Error :

Object CDONTS not found!

Cause : CDONTS is not installed on your server. Use CDO version instead

Page 28: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 27

Actions Performed by ASU

When you run setup.php and setup.asp , the ASU does following

1. Creates “data” folder in kmita folder.

2. Creates a configuration file named formname with asp or php extension. Kmita Mail never deletes or overwrites your existing formname files. For. Ex. You already have a form name file called contact.php. If you again try to make a form with name contact, then Kmita Mail will not overwrite contact.php , instead, it will add a number in front of contact and create contact1.php.

3. Creates Auto responder text file.l

4. Creates Data File

5. In CDO and SMTP versions, the ASU also creates smtp.asp and smtp.php respectively. This file stores the SMTP server data you enter in the first form setup. If you want to change the server details, you can directly edit it in data .folder or delete the file and then again run ASU.

Page 29: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 28

Modifying Form Configuration Files

In case if you require modifying the configuration file, you can follow either of two methods. Method 1 Delete the configuration file in data folder and run ASU again. Method 2

1. Download the configuration file using your favourite FTP client located in data folder. 2. Delete the configuration file after downloading. 3. Modify the configuration file and upload the configuration file to data folder.

PHP Configuration File <? //These is the to, cc, bcc fields $to="[email protected]"; $cc="[email protected]"; $bcc=""; //Configuration of the Emails $subject="Website Form Data"; $success="http://www.kmita-mail.com/success.htm"; $error="http://www.kmita-mail.com/error.htm"; //Autoresponder $autores=1; $autsub="Thank you !"; $autotext="contact0.auto"; //Database $database=0; $datafile="0"; ?>

ASP Configuration File <% 'These are the to, cc, bcc fields tto = "[email protected]"

Page 30: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 29

cc = "[email protected] " bcc = "" 'Configuration of the Pages. '---------------------------- 'Change the success and error pages over here subject = "Website Form Data" success = " http://www.kmita-mail.com/success.htm" error = " http://www.kmita-mail.com/error.htm" 'Configuration of the Database '------------------------------ 'Enter the name of file within double quotation marks database = 1 datafile = "test0.data" 'Auto-responder Configuration '---------------------------- 'To enable autoresponder put autores=1 , put autosub="Your Email Subject" and name of the file , contents of which are to be emailed in autotext= "name_of_the_file". 'IMPORTANT : The location of this file should be in data directory. autores = 1 autosub = "Thank you !" autotext = "test0.htm" %>

You may use Method 2 if you understand ASP or PHP variables. Method 1 is however best if do not want to open code files.

Caution: Modifying the configuration files may lead non functioning of that form. Modify the files only if you have knowledge about ASP or PHP.

Page 31: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Automatic Setup Utility - 30

//// UNIX , LINUX Errors :

Cannot Delete formname.php

Cause : This happens when UNIX or LINUX does not allow FTP user to delete the files which created by apache user. Remedy : Use delete.php to delete files instead of FTP.

Page 32: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Building HTML Form - 31

Chapter 5 Building HTML Form

Page 33: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Building HTML Form - 32

Essentials in HTML Form

On the second page of Kmita Mail ASU, Kmita Mail provides following HTML tag which you need to use in your forms.

1. Form Tag 2. Hidden input tag formname 3. Input tag Email

If you already have a form, you need to modify your form by adding the above fields. Form Tag Form tag specifies method of send data from your HTML form to Kmita Mail. The action in the form tag specifies the location of Kmita Mail. E.g. <form name="form2" method="post" action="http://www.yourwebsite.com/yourpath/submit.php?go=1" > Hidden input tag formname The formname input tag tells Kmita Mail, which form to execute. Kmita Mail then opens the form configuration and then sends data to the email addresses in To, CC and BBC, sends Auto responder to visitor and sends the visitor to Success Page. E.g. <input type="hidden" name="formname" value="contact1.php" > Input tag Email This is mandatory tag to which the auto responder is sent. You can place this tag wherever you wish to have your visitor’s email address. <input type="text" name="Email"> If you wish have a form without the user providing email address, then you can use following tag. <input type="hidden" name="Email" value="[email protected]" >

Page 34: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Building HTML Form - 33

Field Names Formatting

You can choose any name for form tags except formname. You can include “_” (underscore) which will be removed in the Data Email which you’ll receive.

Note : You cannot use special characters like – “/” , “\” , “:”, “(”, “)” , “{”, “}” , “[”, “]”, etc. for proper functioning of Kmita Mail.

Page 35: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 34

Chapter 6 ADVANCED KMITA MAIL FUNCTIONS

Page 36: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 35

Conditional Form Submission

There are cases when you need to send email to different people through same form depending upon the selection made by the visitor. For example, in a contact form you can have a drop down menu which asks the visitor to specify the recipient or if you want to create a form which has conditional data handling like providing details for Product 1 Product 2 Product 3 Product 4 or Marketing Sales Finance Purchase ..... ..... or send email to any one Allen Jim Thomas Peter ...... ...... There can be n number of such applications and it for you to decide how you can use it. As you know, "formname" field tells Kmita Mail which form to execute. < input type="hidden" name="formname" value="contactus.php" > So, if you want a script form to submit data to different email addresses according to formname selected. You are not required to make different HTML forms for each. There are two options . Either have 1. Radio Buttons, or 2. Drop Down Menu

Page 37: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 36

Step 1. Run setup.php for as many options you want to create. This gives you the option of giving different Success Page Autoresponder Data file for each form! No generalised autoresponder! E.g. For support you can provide by what time you can provide support and also provide instructions and Marketing or Sales you can provide where to contact your marketing people and bit of thank you text with flowery language. Copy the "formname" value-> text for each form setup. Step 2 Make a HTML form. Step 3 Now this step differs for Radio Button and Drop Down Menu For Radio Button Use the code below to get Radio Buttons for whom to submit data. The visitor selects the radio button and the email is sent through the indicated formname by Kmita Mail. <input type="radio" name="formname" value="mktg.php" checked> Marketing<br> <input type="radio" name="formname" value="sales.php"> Sales<br> <input type="radio" name="formname" value="purchase.php"> Purchase<br> <input type="radio" name="formname" value="finance.php"> Finance<br> <input type="radio" name="formname" value="resel.php"> Reseller Options Ensure that at least one form is checked other Kmita Mail will send the email data to website administrator email address. This is how the above code looks like

Page 38: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 37

For Drop Down Menu Use the code below to get Drop Down Menu for whom to submit data. The visitor selects the required person from menu and the email is sent through the indicated formname by Kmita Mail. <select name="formname"> <option value="mktg.php" selected>Marketing</option> <option value="sales.php">Sales</option> <option value="purchase.php">Purchase</option> <option value="finance.php">Finance</option> <option value="resel.php">Resseller</option> </select> Ensure that atleast one form is selected other Kmita Mail will send the email data to website administrator email address. Above code looks like this

Page 39: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 38

Note : Kmita Mail cannot handle multiple "formname"'s . If it receives multiple form names, it will only execute the last formname that is specified or in some cases it may give error.

Page 40: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 39

Kmita Mail as Download Manager

Kmita Mail can be used as download manager because 1. Download is restricted as one has to fill a form to get the download file. 2. The visitor does not know the location of the file to be downloaded , hence there is no bandwidth eating up due to linking For creating a download form you need to run ASU and provide the URL of the file which you want visitors to download in the Success URL . In the example below you can see the location of manual.pdf in the Success URL field.

Note : Instead of providing link to a HTML, TXT, PHP, ASP, etc. page, provide the location of your file ( ZIP, EXE, PDF, DOC, etc. ) to be downloaded.

Page 41: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 40

Multi-page forms using Kmita Mail

Multi page forms are an easy way of splitting up large form into number of number of forms spread over number of pages. Visitors on internet do not like to fill forms, especially the forms which run for several screens; Multi page forms can help you by tempting your customer to fill very few fields on first page and then asking more information on the following pages. What you need to have a multi page form?

1. A form setup normally using ASU 2. A Long form.

Step 1. Split your form based on the content. For example , contact information of one page, details about occupation on other page. You can split the form into any number of pages but consider that people on internet do not have much patience. They may leave your form half if they cannot get to the end of the form. If you have a long form, mention like “Page 4 of 10” , “4 pages more to go”, etc. This lets the visitor know how many pages he still has to fill. Step 2 Once you have split the big form you need to make individual pages having the part of the as if it were to be executed individually. Each form page should have extension PHP or ASP depending upon the platform on which you are working. The action value of the form tag should be the next form page and the last page should have the formname input tag and the action should be that given by Kmita Mail’s ASU. The Email input tag can be anywhere in your form pages. Step 3 Place the following code just below the form tag in all the form pages except the first one. If you are using PHP page then insert this code. <? foreach ($_POST as $key => $value) { $value = stripslashes($value); ?> <input type="hidden" name="<? echo $key; ?>" value="<? echo $value; ?>" > <? } ?>

Page 42: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 41

If you are using ASP page then insert this code. <% for each item in Request.Form varval=Request.Form(item) %> <input type="hidden" name="<% Response.write (item) %>" value="<% Response.write varval %>" > <% next %> Contact Support should you require help.

Page 43: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Advanced Kmita Mail Functions - 42

Sequence of Fields in Data Email

To change the sequence of the fields in the Data Email include following HTML tag in your HTML form. <input type="hidden" name="_sequence" value="Contact_Name,Quote,Item_No,Design_No,Ring_Color,Metal,Ring_Size,Email,Country,Date_ready_by,message"> As you see above , the value of the _sequence field specifies the all the names of the fields. Please note that there is no space between the comma (,) and the name of the fields.

Note : If you put incorrect field names in the _sequence field, you would not get the values submitted by the form. Also if you miss some field names, the field values won’t be included in the data email.

Page 44: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Form Validation - 43

Chapter 7 FORM VALIDATION

Page 45: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Form Validation - 44

You can use Tigra Form Validator for validation of your forms. This is javascript application and is easy to implement. It provides following features

• Multiple forms per page supported • Number of verified form fields is not limited • Form fields can be verified to match predefined formats:

o alphabetic (i.e. full name) o alphanumeric (i.e. nickname) o unsigned integer o integer o real (float) number o e-mail address o phone number (incl. hyphens & dots) o date dd-mm-yyyy - (customizable) o time hh:mm:ss - (customizable)

• Relation checks across form fields (i.e. password match) • Highlights form field labels on error • Prevents multiple submits by blocking specified controls • Error reporting via alert box • Optional set up error reporting • Minimum efforts to set up and maintain • All popular browsers supported (compatibility table) • Future browser's versions ready • The script is free for any applications

http://www.softcomplex.com/products/tigra_form_validator/ You can also use tools like Dreamweaver for validation of your forms.

Page 46: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Glossary- 45

Chapter 8 Glossary

Page 47: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Glossary- 46

BCC BCC is an abbreviation for blind carbon copy. If you add a recipient's name to this box in a message, a copy of the message is sent to that recipient, and the recipient's name is not visible to other recipients of the message. CHMOD CHMOD stands for "Change Mode" . CHMOD is used for changing mode of usage of the file. The mode parameter consists of three octal number components specifying access restrictions for the owner, the user group in which the owner is in, and to everybody else in this order. One component can be computed by adding up the needed permissions for that target user base. Number 1 means that you grant execute rights, number 2 means that you make the file writeable, number 4 means that you make the file readable. Add up these numbers to specify needed rights. You can also read more about modes on UNIX systems with 'man 1 chmod' and 'man 2 chmod'. Set these settings using some FTP Client like WS_FTP, ACE FTP, Cute FTP, to name a few. The following steps are mostly common for all FTP clients 1. Right click the folder "kmita" 2. A menu pops up, Select CHMOD or Set File Permissions. 3. A new Dialogue box appears. Set CHMOD 777, (Onwer : Read, Write, Execute | Group : Read, Write, Execute | Public : Read, Write, Execute ) 4. and Thats Done! You can also do the same at UNIX command prompt.

Page 48: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Index- 47

Chapter 9 Index

Page 49: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Index- 48

ASP, 13 CDO, 9, 13 CDONTS, 9, 13 CDOSYS, 9 CHMOD, 17 configuration file, 11, 22, 27, 28 delete.php, 30 download manager, 8, 39 Features, 7 Folder Permissions, 17 formname, 11 FTP, 16 PHP, 13 Sendmail, 13 sequence, 23, 42 SMTP, 13, 27 System Requirements, 9 validation, 44 ZIP, 10, 14

Page 50: ASP and PHP · Version 1.0 ASP and PHP Setup Manual 44, Ambazari Layout, Nagpur, MH, India – 440033 Phone : +91 712 223 7066, 223 5838 Fax : +91 712 223 5838

Index- 49

20040808