Mam problem z kodem forularza który zamieszczam poniżej. Po edycji tego kodu - dodanie pola Data wszystko się posypało i wykrzaczyło mi Wordpressa ;/ Czy macie może pomysł jaki zrobiłem błąd? ;/ Wiem, że tek konkretny plik powoduje problem z WP.
Z góry dziękuje za pomoc,
Pozdrawiam
Formularz:
<?php /* * Contact Form * Inspired by <a href="http://trevordavis.net/blog/wordpress-jquery-contact-form-without-a-plugin" target="_blank">http://trevordavis.net/blog/wordpress-jque...ithout-a-plugin</a> */ $nameError=''; $dataError='': $emailError=''; $commentError=''; $captchaError=''; //If the form is submitted //Check to make sure that the name field is not empty $nameError = __('Zapomniano wprowadzić Imienia i Nazwiska','SimpleKey'); $hasError = true; } else { } $dataError = __('Zapomniano wprowadzić daty','SimpleKey'); $hasError = true; } else { } //Check to make sure sure that a valid email address is submitted $emailError = __('Brak adresu E-mail','SimpleKey'); $hasError = true; $emailError = __('E-mail nieprawidłowy','SimpleKey'); $hasError = true; } else { } //Check to make sure comments were entered $commentError = __('Brak treści wiadomości','SimpleKey'); $hasError = true; } else { if(function_exists('stripslashes')) { } else { } } //Check Captcha $captchaError = __('Wpisz ciąg z obrazka.','SimpleKey'); $hasError = true; } else { if($_POST['captcha']!==$_SESSION['van_captcha']) { $captchaError = __('Przepisany kod jest błędny.','SimpleKey'); $hasError = true; } } } //If there is no error, send the email $emailTo = $VAN['email']; $subject = get_bloginfo('name').' Nowa wiadomość ze strony www '.$name; $body = "Imię: $name \n\nEmail: $email \n\nData: $data \n\nComments: $comments"; $headers = 'Od: '.$name.' <'.$email.'>' . "\r\n" . 'Odpowiedz do: ' . $email; wp_mail($emailTo, $subject, $body, $data, $headers); $emailSent = true; } } ?> <div class="contactform"> <span class="success"><?php _e('Dziękuje :) E-mail został wysłany. Odpowiem najszybciej jak to możliwe.','SimpleKey');?></span> <?php }else{ ?> <?php if($nameError !== ''){?> <?php } if($emailError !== ''){?> <?php if($dataError !== ''){?> <?php }if($commentError !== ''){?> <?php }if($captchaError !== ''){?> <?php }?> <form id="contactForm" method="post" action="?"> <label><textarea class="requiredField" name="comments" id="comments" placeholder="<?php _e('Treść wiadomości','SimpleKey');?>"><?php if(function_exists('stripslashes')) { } else { } } ?></textarea></label> <div class="cp"> <input type="text" name="captcha" id="captcha" value="" class="requiredField captcha" placeholder="<?php _e('Przepisz kod','SimpleKey');?>" /><a href="java script:refreshCaptcha();" class="cpt-img"><img id="mycaptcha" src="<?php echo get_template_directory_uri();?>/functions/captcha/van_captcha.php?rand=<?php echo rand();?>" /></a> </div> <input type="hidden" name="get_captcha" id="get_captcha" value="<?php echo $_SESSION['van_captcha'];?>" /> <?php endif;?> <input type="hidden" name="submitted" id="submitted" value="true" /> <div class="clearfix"></div> <button type="submit" name="submit" id="submitMsg" class="large_btn contact-btn"><?php _e('Wyślij','SimpleKey');?></button> </form> <?php }?> <script type="text/javascript"> //Ajax feedback message var forgot_error='<?php _e('Zapomniano wpisać','SimpleKey');?>'; var email_error='<?php _e('Wprowadzono błędny','SimpleKey');?>'; var success='<?php _e('Dziękuje :) E-mail został wysłany. Odpowiem najszybciej jak to możliwe.','SimpleKey');?>'; function refreshCaptcha(){ var img = document.images['mycaptcha']; img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000; } </scrip1t> </div>1