View Single Post
Old 09-08-2007, 01:41 AM   #1 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,267
Thanks: 90
Wildhoney is on a distinguished road
Simple & Expansive Contact Form

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!
Attached Files
File Type: zip TalkPHP.Contact.zip (1.2 KB, 131 views)
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote