Required fields in contact form

Home Forums All Other Themes Required fields in contact form

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #58040
    Eva-MariaEva-Maria
    Member
    • Topics: 1
    • Replies: 4
    • Total: 5
    Member since: April 4, 2016

    I changed the translation in the custom-functions.php. Now all my required fields are gone and the email isn`t sent 🙁 Nothing happens 🙁

    Can somebody help?

    This is the Website: http://www.friseurjulia.de/kontakt/

    Here is the code I changed:

    function contactform_func( $atts ) {
    $atts = shortcode_atts( array(
    ‘to_email’ => get_bloginfo(‘admin_email’),
    ‘title’ => ‘Contact enquiry – ‘.home_url( ‘/’ ),
    ), $atts );

    $cform = “<div class=\”main-form-area\” id=\”contactform_main\”>”;

    $cerr = array();
    if( isset($_POST[‘c_submit’]) && $_POST[‘c_submit’]==’Submit’ ){
    $name = trim( $_POST[‘c_name’] );
    $email = trim( $_POST[‘c_email’] );
    $phone = trim( $_POST[‘c_phone’] );
    $website = trim( $_POST[‘c_website’] );
    $comments = trim( $_POST[‘c_comments’] );
    $captcha = trim( $_POST[‘c_captcha’] );
    $captcha_cnf = trim( $_POST[‘c_captcha_confirm’] );

    if( !$name )
    $cerr[‘name’] = ‘Bitte tragen Sie Ihren Namen ein.’;
    if( ! filter_var($email, FILTER_VALIDATE_EMAIL) )
    $cerr[’email’] = ‘Bitte geben Sie eine gültige Emailadresse an.’;
    if( !$phone )
    $cerr[‘phone’] = ‘Bitte geben Sie Ihre Telefonnummer an, damit wir bei Rückfragen erreichen können.’;
    if( !$comments )
    $cerr[‘comments’] = ‘Bitte schreiben Sie uns eine Nachricht.’;
    if( !$captcha || (md5($captcha) != $captcha_cnf) )
    $cerr[‘captcha’] = ‘Bitte tragen Sie das korrekte Ergebnis ein.’;

    if( count($cerr) == 0 ){
    $subject = $atts[‘title’];
    $headers = “From: “.$name.” <” . strip_tags($email) . “>\r\n”;
    $headers .= “MIME-Version: 1.0\r\n”;
    $headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;

    $message = ‘<html><body>
    <table>
    <tr><td>Name: </td><td>’.$name.'</td></tr>
    <tr><td>Email: </td><td>’.$email.'</td></tr>
    <tr><td>Telefon: </td><td>’.$phone.'</td></tr>
    <tr><td>Website: </td><td>’.$website.'</td></tr>
    <tr><td>Nachricht: </td><td>’.$comments.'</td></tr>
    </table>
    </body>
    </html>’;
    mail( $atts[‘to_email’], $subject, $message, $headers);
    $cform .= ‘<div class=”success_msg”>Vielen Dank für Ihre Anfrage! Wir werden uns so schnell wie möglich bei Ihnen melden.</div>’;
    unset( $name, $email, $phone, $website, $comments, $captcha );
    }else{
    $cform .= ‘<div class=”error_msg”>’;
    $cform .= implode(‘<br />’,$cerr);
    $cform .= ‘</div>’;
    }
    }

    $capNum1 = rand(1,4);
    $capNum2 = rand(1,5);
    $capSum = $capNum1 + $capNum2;
    $sumStr = $capNum1.” + “.$capNum2 .” = “;

    $cform .= “<form name=\”contactform\” action=\”#contactform_main\” method=\”post\”>
    <p><input type=\”text\” name=\”c_name\” value=\””. ( ( empty($name) == false ) ? $name : “” ) .”\” placeholder=\”Name\” /></p>
    <p><input type=\”email\” name=\”c_email\” value=\””. ( ( empty($email) == false ) ? $email : “” ) .”\” placeholder=\”Email\” /></p><div class=\”clear\”></div>
    <p><input type=\”tel\” name=\”c_phone\” value=\””. ( ( empty($phone) == false ) ? $phone : “” ) .”\” placeholder=\”Telefon\” /></p>
    <p><input type=\”url\” name=\”c_website\” value=\””. ( ( empty($website) == false ) ? $website : “” ) .”\” placeholder=\”Website\” /></p><div class=\”clear\”></div>
    <p><textarea name=\”c_comments\” placeholder=\”Nachricht\”>”. ( ( empty($comments) == false ) ? $comments : “” ) .”</textarea></p><div class=\”clear\”></div>”;
    $cform .= “<p><span class=\”capcode\”>$sumStr</span><input style=\”width:200px;\” type=\”text\” placeholder=\”Ergebnis\” value=\””. ( ( empty($captcha) == false ) ? $captcha : “” ) .”\” name=\”c_captcha\” /><input type=\”hidden\” name=\”c_captcha_confirm\” value=\””. md5($capSum).”\”></p><div class=\”clear\”></div>”;
    $cform .= “<p class=\”sub\”><input type=\”submit\” name=\”c_submit\” value=\”Abschicken\” class=\”search-submit\” /></p>
    </form>
    </div>”;

    return $cform;
    }
    add_shortcode( ‘contactform’, ‘contactform_func’ );

    #58090
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    Hi Eva,

    Kindly send us your URL of the site and WordPress admin details via sktthemes.net/contact

    Please mention this forum URL while replying so that we understand what needs to be done.

    Regards,
    Brad

    #58871
    Eva-MariaEva-Maria
    Member
    • Topics: 1
    • Replies: 4
    • Total: 5
    Member since: April 4, 2016

    Did you receive my Email?

    #58876
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    Hi,

    We didn’t receive any email from you. Kindly send us via sktthemes.net/contact

    Regards,
    Brad

    #58878
    Eva-MariaEva-Maria
    Member
    • Topics: 1
    • Replies: 4
    • Total: 5
    Member since: April 4, 2016

    I did send it again….hope you received it now 😉

    #58881
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    Recieved

    #58934
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    Hi,

    This issue was resolved from our end. Kindly check and confirm.

    Regards,
    Brad

    #58961
    Eva-MariaEva-Maria
    Member
    • Topics: 1
    • Replies: 4
    • Total: 5
    Member since: April 4, 2016

    It is working so far 🙂 Now the only Problem is, that the emails aren’t sent 🙁 Where are they now?

    #59021
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    Hi,

    Emails sent on info@friseurjulia.de

    You can change the email address from sidebar.php

    Regards,
    Brad

    #59023
    Eva-MariaEva-Maria
    Member
    • Topics: 1
    • Replies: 4
    • Total: 5
    Member since: April 4, 2016

    Ah…OK….that i didn’t know…
    Thanks for your help 🙂

    #59026
    Forum ModeratorForum Moderator
    Participant
    • Topics: 0
    • Replies: 26902
    • Total: 26902
    Member since: August 16, 2013

    🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Required fields in contact form’ is closed to new replies.