TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Script Giveaway (http://www.talkphp.com/script-giveaway/)
-   -   Simple & Expansive Contact Form (http://www.talkphp.com/script-giveaway/1052-simple-expansive-contact-form.html)

Wildhoney 09-08-2007 01:41 AM

Simple & Expansive Contact Form
 
1 Attachment(s)
For our first script giveaway I have coded a simple contact form. This script is easy to expand onto, all you have to do to add more fields is follow the simple rules:
  • Add an input box, select area, text area - whichever field type you desire to the form.
  • Give its name a prefix of txt and then follow it by the name of the actual label you wish to associate with its value.

For instance:

Code:

<p>
        <label for="txtName">Name:</label>
        <input type="text" name="txtName" id="txtName" />
</p>

This would show up in the e-mail as:

Quote:

Name: myName
As you can see in the above example, the word name appears 3 times. The label node, and subsequently the ID attributes, are optional. However, the name attribute on the <input> node is required for the contact form to work correctly.

If you open up the file contained within the /lib/ directory entitled TalkPHPContact.class.php then you can edit the 2 important defines. These are:

PHP Code:

const RECEPIENT    'script@talkphp.com';
const 
TITLE        'TalkPHP - Contact'

  • RECEPIENT: The person who the e-mail will be sent to.
  • TITLE: The title of the e-mail

By default the form supports the following:
  • Name
  • Email
  • Inquiry

Any questions about the script, don't hesitate to respond within this thread. Enjoy it!

Craddock 09-11-2007 10:55 AM

I'm using it, Thanks :)

daz 09-11-2007 02:54 PM

This is a great script Wildhoney but is there any need to use classes and such for a small script like this?

Wildhoney 09-11-2007 03:00 PM

None at all except my feeling that people may wish to expand onto it and thus I've started them off in the right direction!

Wildhoney 09-11-2007 03:04 PM

1 Attachment(s)
Some people have asked for a PHP4 version of the contact form. Here it is! :)


All times are GMT. The time now is 08:38 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0