Plugin Directory

Changeset 656078


Ignore:
Timestamp:
01/21/2013 03:55:16 AM (13 years ago)
Author:
anildhiman
Message:

introduce numeric captcha

Location:
mj-contact-us/trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • mj-contact-us/trunk/css/mj.css

    r654989 r656078  
    141141.h-100{height:100px;}
    142142.f-13{font-size:13px;}
     143.error{background-color: #e77776; color: #f2f2f2}
  • mj-contact-us/trunk/files/includes.php

    r654989 r656078  
    1111DEFINE('ACTION' , $atn);
    1212
    13 include( plugin_dir_path( __FILE__ ) . '/mj-class-process.php');
     13include( plugin_dir_path( __FILE__ ) . '/simple-php-captcha.php');
     14include( plugin_dir_path( __FILE__ ) . '/mj-class-functions.php');
     15include( plugin_dir_path( __FILE__ ) . '/mj-class-process.php');
    1416include( plugin_dir_path( __FILE__ ) . '/mj-class-html.php');
    1517
  • mj-contact-us/trunk/files/mj-class-html.php

    r654989 r656078  
    55    ?>
    66    <div>
    7     <?php if(isset($_REQUEST['MSG']) && $_REQUEST['MSG']=="SUCCESS"){
    8         echo "<div class='updatedcss' id='message'> Mail Sent Successfully</div>";
    9     }
    10     ?>
    117
    128    <script type="text/javascript">
     
    5248                </div>
    5349                <?php endif; ?>
     50                <?php //if(get_option('MJCapcha')==0):?>
     51                <div class="h-71">
     52                    <label for="message"><?php _e('Captcha : '. MjFunctions::MathCaptcha()) ;?></label>
     53                    <input id="captcha" required name="captcha" type="text" value=""  aria-required="true">
     54                </div>
     55                <input type="hidden" name="CODEINCODE" value="<?php echo MjFunctions::BaseIncode(); ?>">
     56                <?php //endif; ?>
    5457                <div>
    55                     <input name="mj_submit" type="submit" id="submit" value="<?php _e('Send') ;?>">
     58                   
     59
     60                    <input name="mj_submit" type="submit" id="submit" value="<?php _e('Send') ;?>">
    5661                    <input type="hidden" name="mj_submit" value="active">
    5762                    <input type="hidden" name="page_id" value="<?php echo $post->ID; ?>">
     63
    5864                </div>
    5965            </form>
     
    6167            </div>
    6268    <?php
    63        
    6469    }
    6570    function AdminOption(){ ?>
  • mj-contact-us/trunk/files/mj-class-process.php

    r654989 r656078  
    22
    33    public static function send_mail(){
    4         if(isset($_REQUEST['mj_submit']) && $_REQUEST['mj_submit']=="active"){
    5             self::copytome();
    6             $name       =   strip_tags($_REQUEST['uname']);
    7             $email      =   $_REQUEST['email'];
    8             $subject    =   strip_tags($_REQUEST['subject']);
    9             $url        =   strip_tags($_REQUEST['url']);
    10             $comment    =   strip_tags($_REQUEST['comment']);
    11             $to         =   (get_option('MJmailto')) ? get_option('MJmailto') : get_option('admin_email');
    12             $subject    =   (empty($subject))? "Contact Us mail" : $subject;
    13             $message = "
    14             <html>
    15                 <head>
    16                     <title>Contact US Mail</title>
    17                 </head>
    18                 <body>
    19                     <p>Hello Admin<br/></p>
    20                     <p>Please find the details of contact us mail send by a new user</p>
    21                     <p>=============================================================</p>
    22                     <table>
    23                         <tr>
    24                             <th>Name : </th>
    25                             <td>{$name}</td>
    26                         </tr>
    27                         <tr>
    28                             <th>Email : </th>
    29                             <td>{$email}</td>
    30                         </tr>
    31                         <tr>
    32                             <th>Subject : </th>
    33                             <td>{$subject}</td>
    34                         </tr>
    35                         <tr>
    36                             <th>Website : </th>
    37                             <td>{$url}</td>
    38                         </tr>
    39                         <tr>
    40                             <th>Comment : </th>
    41                             <td>{$comment}</td>
    42                         </tr>
    43                     </table>
    44                     <p>=============================================================</p>
    45                     <p>Thanks & Regards</p>
    46                 </body>
    47             </html>
    48             ";
    49             $headers  = 'MIME-Version: 1.0' . "\r\n";
    50             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    51             $headers .= 'From: '.$to.'' . "\r\n" .
    52             'Reply-To: '.$to.'' . "\r\n" .
    53             'X-Mailer: PHP/' . phpversion();
    54            
    55             wp_mail($to,$subject,$message,$headers);
    56             $redirecturl    =    add_query_arg( 'MSG', 'SUCCESS', get_permalink($_REQUEST['page_id']) );
    57             echo "<script>window.location.href='$redirecturl'</script>";
    58        
    59         }
     4        if(isset($_POST['mj_submit']) && $_POST['mj_submit']=="active"){
     5            if($_REQUEST['captcha'] ==   MjFunctions::BaseDecode($_POST['CODEINCODE'])){
     6                self::copytome();
     7                $name       =   strip_tags($_REQUEST['uname']);
     8                $email      =   $_REQUEST['email'];
     9                $subject    =   strip_tags($_REQUEST['subject']);
     10                $url        =   strip_tags($_REQUEST['url']);
     11                $comment    =   strip_tags($_REQUEST['comment']);
     12                $to         =   (get_option('MJmailto')) ? get_option('MJmailto') : get_option('admin_email');
     13                $subject    =   (empty($subject))? "Contact Us mail" : $subject;
     14                $message = "
     15                <html>
     16                    <head>
     17                        <title>Contact US Mail</title>
     18                    </head>
     19                    <body>
     20                        <p>Hello Admin<br/></p>
     21                        <p>Please find the details of contact us mail send by a new user</p>
     22                        <p>=============================================================</p>
     23                        <table>
     24                            <tr>
     25                                <th>Name : </th>
     26                                <td>{$name}</td>
     27                            </tr>
     28                            <tr>
     29                                <th>Email : </th>
     30                                <td>{$email}</td>
     31                            </tr>
     32                            <tr>
     33                                <th>Subject : </th>
     34                                <td>{$subject}</td>
     35                            </tr>
     36                            <tr>
     37                                <th>Website : </th>
     38                                <td>{$url}</td>
     39                            </tr>
     40                            <tr>
     41                                <th>Comment : </th>
     42                                <td>{$comment}</td>
     43                            </tr>
     44                        </table>
     45                        <p>=============================================================</p>
     46                        <p>Thanks & Regards</p>
     47                    </body>
     48                </html>
     49                ";
     50                $headers  = 'MIME-Version: 1.0' . "\r\n";
     51                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     52                $headers .= 'From: '.$to.'' . "\r\n" .
     53                'Reply-To: '.$to.'' . "\r\n" .
     54                'X-Mailer: PHP/' . phpversion();
     55
     56                wp_mail($to,$subject,$message,$headers);
     57                echo "<div class='updatedcss' id='message'> Mail Sent Successfully</div>";
     58            }else{
     59                echo "<div class='error p-12' id='message'>Invalid Captcha</div>";
     60            }
     61        }
    6062    }
    6163   
  • mj-contact-us/trunk/index.php

    r654989 r656078  
    55Description: mj contact us a simple form with 4-5 fields to send email address to admin . its a simple contact us form with easy to customize coding standard and easy to customize html standard. <strong>add this code</strong> [mjcontactus] <strong>in page from admin section to activate plugin form also be sure that you have get_header() function in your header file so that validation can be work properly</strong>
    66Author: anil kumar
    7 Version: 5.2
     7Version: 5.1
    88Author URI: http://about.me/anilDhiman
    99*/
     
    2929function mj_contact_us(){
    3030    $object =   new mjContactHTML;
    31     $object->mjForm();
    32     $object->send_mail();
     31    $object->send_mail();
     32    $object->mjForm();
    3333}
    3434function AdminIndex(){
  • mj-contact-us/trunk/readme.txt

    r655312 r656078  
    22Contributors: anildhiman
    33Donate link: http://mecontact.wordpress.com/mj-contact-us-plugin/
    4 Tags: contact us, simple and easy contact us form, contact us form, contact form, wordpress contact form, wordpress simple contact us form, javascript
    5 contact us form, customizable contact us form
     4Tags: contact us, simple and easy contact us form, contact us form, contact form, wordpress contact form, wordpress simple contact us form, javascript contact us form, customizable contact us form, captcha contact us form, numeric captcha
    65Requires at least: 3.0.1
    76Tested up to: 3.5
     
    2726<li> - easy to add new fields by customising form</li>
    2827<li> - easy to understand coding standard</li>
     28<li> - contact us with numeric captcha</li>
    2929</ul>
    3030
     
    6363 * added admin options
    6464 * validations are optional
    65 
     65 * introduce numeric captcha. like 12 + 2 - 4 = ?
     66 
    6667= 5.1 =
    6768 * add the jquery validation
Note: See TracChangeset for help on using the changeset viewer.