p01-contact is a php script who let you simply create advanced contact forms.
p01-contact is natively a plugin for GetSimple cms.
There is hundred of sites using this script, here are some examples :
plugins/ directory.Include the script :
include 'path/to/p01-contact/p01-contact.php';
Create a P01contact instance :
$p01contact = new P01contact();
Define default email address with :
$p01contact->default_email = 'address@domain.ext';
Add form(s) by parsing a string containing tags according to the syntax described below :
echo $p01contact->parse($string);
For example, to display a default contact form :
$p01contact = new P01contact(); $p01contact->default_email = 'address@domain.ext'; echo $p01contact->parse('(% contact %)');
Simply write in a page a tag according to the syntax described below, and a form will appear!
Reminds you to fill the Meta Description, accessible in page options →
If you don't, GetSimple will show the tag in the source code of the output page.
You can use it everywhere you want by manipulating the variable $p01contact, already initialized.
To parse a string and replace tags by forms, use :
$p01contact->parse($string);
For example, to display a default contact form in your sidebar :
<?php get_component('sidebar'); echo $p01contact->parse('(% contact %)'); ?>
The syntax used is really simple, but powerfull.
The minimum tag is :
(% contact %)
It create a default form (see Default params in settings) destinated to the default email address (see Default email in settings).
In the following, to define some parameters we will follow the word “contact” with a colon :
(% contact : parameters %)
You can define any recipients you want by adding valid addresses separated by commas, like :
(% contact : address@domain.ext %)
(% contact : address@domain.ext, another@domain.ext %)
(% contact : address@domain.ext, another@domain.ext... %)
You can construct your own form by specifying the fields like you specify the recipients :
(% contact : field, field, field... %)
By replacing field by valid fields types and/or fields options.
There is two sorts of fields types : the specials and the generals.
The specials types are fields doing specific actions :
Those ones are used in mail :
Those ones have a verification of their format :
Those ones protect your forms :
And there is this one too :
These fields are not doing anything special, but they are displayed in mail content.
If you enter an unknown field type, no field will be displayed but its name will be displayed and mentioned in <div> class :
(% contact : something %)
<div class="field something"> <div class="label"> <label>The title</label> </div> </div>
Use that to create separations texts, titles, answer/response…
(% contact : answer "This is an answer", response "This is the response" %)
/* apply to every fields */ .p01-contact .field{margin:5px;} /* those are known fields */ .p01-contact .text{margin:5px;} .p01-contact .captcha{margin:10px;} /* those are user-defined fields (labels only) */ .p01-contact .answer{color:red;} .p01-contact .response{color:blue;}
message!
A required field left empty will display a “This field is required” error.
message "Tell me something :"
message = value
Except for password field, where that define required value :
password = required value
For multiple values fields, separate values by vertical bars :
checkbox = "value1" selected | "value2" selected | "value3" select = "value1" | "value2" selected | "value3" radio = "value1" | "value2" | "value3" selected
Note the use of selected keyword to define selected value(s).
message => value
Works with multiple values fields :
select => "value1" | "value2" selected | "value3"
fieldType! "title" => value
Default :
(% contact %)
Default with defined recipients :
(% contact : recipient@domain.ext, other@domain.ext %)
Advanced form construction :
A minimal one :
(% contact : email!, message! %)
A big one :
(% contact : address@domain.ext, another@domain.ext,
subject => About this script,
email!,
textarea "How old is born Napoléon?",
phone,
radio "Do you like this script?" = "Yes" selected | "No",
website,
select = "One" selected | "Two" | "Three" | "Four" | "Five" ,
message = Say something!,
password = tomato,
captcha,
askcopy %)
You can display a functionnal configuration panel with :
echo $p01contact->panel();
In GetSimple, simply access to it from the admin panel, in the Plugins tab :
When disabled, the forms are displayed and all the process are executed (fields verifications, etc…) but finally, instead of sending the mail a message “Plugin disabled” is displayed.
Define email used for default froms. Default email can also being set with :
$p01contact->default_email = 'email@domain.ext';
This is indicated in italic below. (for GetSimple, this is set to admin email)
Settings default address prevails to that defined in code.
To send a mail, a form need at least one valid recipient defined in tag, or a valid default email defined in code or a valid default email defined in settings.
Default language is by default to English, and can be set with :
$p01contact->default_lang = 'fr';
For GetSimple, default is the language defined in GetSimple.
You can also define to use a particular language, by selecting one in the list of existing translations. Those beginning with ”~” are not fully translated.
Minimum number of characters to write in message fields to be valid.
This setting does not affect the textarea fields.
This setting let you defining the form structure used when no structure has been set in tag, in other words default tags.
Use the form construction syntax described above.
Blacklist : indicating values that must not be present in the field to send email.
Whitelist : indicating possibles values required for the field to send email.
All values must be separated by commas.
The debug mode disable mail sending and display p01-contact object data structure. If a form is posted, it display data sent and the email that would have been sent.
The last stable version is translated in :
The development release is already translated in :
Some translations are not complete, and will not be included in the next stable release :
Thanks to Martin Köhler, Carlos Navarro, Kristian Salonen, Nicola Sarti, Vaidotas Kazla, Thomas Stolwijk, Evandro Xavier Azevedo, Eugene Vetrov, Göran Söderberg, barlew, Iggy Pritzker, Panayot Kuyvliev and Daniel A. Rodriguez.
p01-contact/lang
(Use development release : there is probably some translation changes since the stable one.)
jp.php.'sentfrom' => 'Translate me here',
/** * Japanese language file * @author Your Name * @package p01-contact */
2010-11-06
Download 0.9.1.zip.
captcha!)
2010-11-05
Download 0.9.zip.
p01contact_gs.php do the link with GS.
2010-10-30 to 2010-11-02
Download 0.8.3.zip or
0.8.2.zip or
0.8.1.zip or
0.8.zip.
2010-10-27
Download 0.7.zip.
2010-10-25
Download 0.6.zip.
I list here the new functionalities and changes expected before the 1.0. Fell free to tell me if you have a cool idea, or if you know how to realise one :
send_mail (send a mail with form answers to recipients), but anything is now possible (pool, newsletter, comments…).? :fieldType?
p01contact/captcha) but fairly easy to circumvent, or current advanced captcha image?
Discussion
send_mail()ligne 647 dep01-contact.php(remplacer leContent-typedu header entext/plainet virer toutes les balises html que vous croisez).Il est tout à fait possible de modifier de n'importe quelle manière l'aspect des formulaires au moyen de feuilles de style (CSS). Le plugin ne fait que générer une structure de données html.
Il n'est pas nécessaire de modifier le code source du plugin pour une utilisation standard.
I would like to use your plugin in a Get Simple site.
How can I change language on the fly: need to do different languages contact page.
Please help
Thanks
You can change script language with :
Of course you need to detect user language, like with :
send_mail()starting line 647 inp01-contact.php.elseifcondition at line 667 by anifcondition :Thank you for really nice plugin. I used it on my work. http://www.jp-transport.pl/kontakt/
I'm glad you like it! Your website is shown in Live examples.
Bonjour,
Comment faire pour ne pas exiger que les champs soit obligatoires ?
Merci beaucoup pour ce plugin!
Bonjour,
Les champs ne sont pas requis par défaut, l'utilisation du point d'exclamation permet de les rendre obligatoires. Cf. Fields options.
My apologies for witting in English, I did not use my French for over 50 years, but I can still read and understand. Thank you for the excellent plugin to Get Simple which I am using in my site http://www.helcan.com/contact-us/ with some minor modification only in the Captcha area.
I would like to make all entry text areas quite a bit wider, but I am lost. When I changed the pO1-contact.php from width 100% to 600 px nothing happened, so I reverted back. Your help will be greatly appreciated, et je vous remercie
Costas
Hi, glad you like it.
This plugin do not offer a form styling, only the html construction : so you have to edit the css, not the script source.
I'm linking to your post in GS forum, for a complete answer : http://get-simple.info/forum/topic/1758/one-more-contact-form-question
Hello,
I keep getting:
in admin/plugins with no config settings for the plugin p01-Contact.
Has anyone seen this?
Hi. Obviously GS doesn't see the plugin. Try to delete/reinstall it.