WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form DB
[Plugin: Contact Form 7 to Database Extension] Add a unique number to each entry (3 posts)

  1. dreamprojects
    Member
    Posted 2 years ago #

    Hello,

    Great plugin but one thing missing for me...

    I need to have a unique number (8 numeric characters)for each entry in order to generate a barcode to send after each subsmission.

    Is this possible?

    Best regards

    Philippe

    http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

  2. AMBA
    Member
    Posted 2 years ago #

    hi i'm intrest about this too
    is for an id increment
    don't see solution yet
    best regards
    Amba

  3. dreamprojects
    Member
    Posted 2 years ago #

    A dear friend has found a solution.

    First he added the following in functions.php of my theme :

    add_filter('cfdb_form_data','myformcallback');
    function myformcallback($form)
    {
    $form->posted_data['barcode'] = (string)substr(time(), 2, 8);
    // var_dump((string)substr(time(), 2, 8)); exit;
    return $form;
    }

    In the contact form itself we added a hidden field : [text barcode class:hidden]

    The barcode is added to the outgoing message with the following link :

    Barcode: <img src="http://www.barcodesinc.com/generator/image.php?code=[barcode]&style=453&type=C128B&width=400&height=100&xres=3&font=3" />

    Hope this works for you too!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic