Hello,
I am using the following code in a modal. Lately we are receiving a lot of spam, how can I setup a honeypot ? What kind of custom field do i have to use ? I have placed some ??????? where I am stuck.
thank you very much for your help.
<?php
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
if ( 'nachricht' !== $config['id'] ) {
return;
}
$deine_email = rwmb_meta( 'deine_email', '', $post_id );
$dein_name = rwmb_meta( 'dein_name', '', $post_id );
$dein_betreff = rwmb_meta( 'dein_betreff', '', $post_id );
$deine_nachricht = rwmb_meta( 'deine_nachricht', '', $post_id );
$honeypot = ????? ;
//the spam honey pot
if ($honeypot != '') {
???????
}
$attachments = array();
$to [] = $deine_email;
$subject = "XXX";
$body = "<p><b>Name</b>: $dein_name</p>
<p>Email: $deine_email</p>
<p>Nachricht: $deine_nachricht</p><br><br>
<p>bla bla bla</p>";
$headers = array(
'Content-type: text/html; charset=UTF-8',
'Reply-To:' . $deine_email . '',
'From: abc Marcus <[email protected]>',
'BCC: $deine_email');
wp_mail($to, $subject, $body, $headers, $attachments );
}, 10, 2 );
?>