2010-04-02, 19:07:58
(This post was last modified: 2010-04-03, 23:29:26 by bobythomas.)
Hello,
You can improve your plugin :
1 - print (with concatenations) => echo (with commas) // performance
2 - Put a real action attribute3 - eregi replacement : 4 - Managing an 'h2' title with a specific class for the form by passing an optionnal param to sc_form function
Moreover, captcha implementation can't work like this.
You are comparing a local variable with a post variable => the local variable is overwritten on POST...
So, the comparison is between the answer to the previous question and the answer to the actual question.
You can improve your plugin :
1 - print (with concatenations) => echo (with commas) // performance
2 - Put a real action attribute
Code:
echo '<form action="',htmlentities($_SERVER['REQUEST_URI']),'" method="post" class="contactform"> // Security
Code:
if (!preg_match("/[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}/", $sc_email)){ // Php 5.3 compatibility
Code:
function sc_form ($formTitle = '')
{
...
if (!empty($formTitle))
{
echo '<h2 class="contactFormTitle">', $formTitle, '</h2>';
}
Moreover, captcha implementation can't work like this.
You are comparing a local variable with a post variable => the local variable is overwritten on POST...
So, the comparison is between the answer to the previous question and the answer to the actual question.