Location: PHPKode > scripts > Lexperts Contact Form > lexperts-contact-form/readme.txt

//////////////////////////////////--Requirement--//////////////////////////////////
- PHP version 4.x
- GD Library


//////////////////////////////////--Files--////////////////////////////////////////
- captcha.php
- contact_form.php
- font/arial.ttf
- font/verdana.ttf
- image/form_bg.jpg
- image/icon/accept.png
- style.css


//////////////////////////////////--Step 1--///////////////////////////////////////
Download and unzip the ÒLexperts Contact FormÓ package, if you havenÕt already. 


//////////////////////////////////--Step 2--///////////////////////////////////////
Open contact_form.php in your favorite text editor and edit ÒCONFIG YOUR E-MAILÒ AND ÒCONFIG YOUR ERROR MESSAGESÓ. 

// CONFIG YOUR E-MAIL
define(ÔSEND_TOÕ, Ôhide@address.comÕ);
Change the e-mail to the one you would like the contact form to be sent.


-----------------------------------------------------------------------------------


define(ÔSUBJECTSÕ, ÔSubject 1, Subject 2, Subject 3Õ);
You can add, edit and delete the subjects. Too seprate the subjects use a comma. Example: Sales, Business, Economics, Technical problems, Management


-----------------------------------------------------------------------------------

define(ÔSUCCESS_MESSAGEÕ, ÔThank you {name}Õ);
This is the message that appears once the contact form is sent.

-----------------------------------------------------------------------------------

define(ÔINBOX_MESSAGEÕ, ÔName: {name} {enter} Company: {company} {enter} E-mail: {email} {enter} Phone number: {phone} {enter} Subject: {subject} {enter} Comment: {enter} {comment}Õ);
This is the messages that you will received on your mailprogram.

For ÒSUCCES_MESSAGEÓ and ÒINBOX_MESSAGEÓ you can call the fields that has been filled in the contact form. This way you can create your own text. In the example you see the form items betwin { }.

{name} This will call the name from the contact form  
{company} This will call the company  from the contact form  
{email} This will call the e-mail from the contact form  
{phone} This will call the phone number from the contact form 
{subject} This will call the subject from the contact form
{comment] This will call the comment from the contact form
{enter} This will create a enter in your mail (only works in INBOX_MESSAGE. For SUCCESS_MESSAGE you can use html/css)

-----------------------------------------------------------------------------------

// CONFIG YOUR ERROR MESSAGES
define(ÔERROR_MESSAGE_NAMEÕ, Ô(Name can\Õt be blank)Õ);
define(ÔERROR_MESSAGE_EMAILÕ, Ô(E-mail can\Õt be blank)Õ);
define(ÔERROR_MESSAGE_EMAIL_INVALIDÕ, Ô(Email is invalid)Õ);
define(ÔERROR_MESSAGE_PHONE_INVALIDÕ, Ô(Phone is invalid)Õ);
define(ÔERROR_MESSAGE_SUBJECTÕ, Ô(Subject can\Õt be blank)Õ);
define(ÔERROR_MESSAGE_COMMENTÕ, Ô(Comment can\Õt be blank)Õ);
define(ÔERROR_MESSAGE_CAPTCHAÕ, Ô(Verification code can\Õt be blank)Õ);
define(ÔERROR_MESSAGE_CAPTCHA_INVALIDÕ, Ô(Verification code is invalid)Õ);
You can edit the error_messages in your own way.

-----------------------------------------------------------------------------------

When you use a single quote in ÒSUBJECTSÓ, ÒSUCCES_MESSAGESÓ, ÒINBOX_MESSAGESÓ and all ÒERROR_MESSAGESÓ make sure that you use a slash-backward. For example: 

Wrong: Subject canÕt be blank.
Right: Subject can\Õt be blank.


//////////////////////////////////--Step 3--///////////////////////////////////////
If you want to include your contact_form.php on your existing php page. Use this code:

<?php include(contact_form.php); ?>

-----------------------------------------------------------------------------------

Make sure when you include the contact form in the page and you already use HTML headers that you remove the following lines:

<!DOCTYPE html PUBLIC Ò-//W3C//DTD XHTML 1.0 Strict//ENÓ Òhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtdÓ>
<html xmlns=Óhttp://www.w3.org/1999/xhtmlÓ dir=ÓltrÓ lang=ÓenÓ xml:lang=ÓenÓ>
<head>
<title>Lexperts Contact Form</title>
<meta name=ÓdescriptionÓ content=ÓLexperts contact formÓ />
<link rel=ÓstylesheetÓ type=Ótext/cssÓ href=Óstyle.cssÓ />
</head>
<body>

And remove the end tags.

</body>
</html>

-----------------------------------------------------------------------------------

The stylesheet you have to call in the new page where you include the form:

<link rel=ÓstylesheetÓ type=Ótext/cssÓ href=Óstyle.cssÓ />

-----------------------------------------------------------------------------------


//////////////////////////////////--Step 4--///////////////////////////////////////
Upload the files to your server.

YouÕre done
Test your contact form and have fun! 

When you have any problems contact me at hide@address.com
Return current item: Lexperts Contact Form