TalkPHP's 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:
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:
Any questions about the script, don't hesitate to respond within the thread. Enjoy it!
This can be downloaded from here:
http://www.talkphp.com/showthread.php?t=1052