TEMA:

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248577

  • Avatar de FiftyNineDesign Autor del tema
  • FiftyNineDesign
  • Fuera de línea
  • Navegador Junior
  • Navegador Junior
  • Registered
  • Mensajes: 74
  • Gracias recibidas: 0
Hallo,

hier wurde ein Beispiel für einen Bad-Word-Filter mit PHP gezeigt:
crosstec.org/en/forums/1-forums/115304-s...nd-spam.html?start=6
$this->execPieceByName('ff_InitLib');

$send = true;

$recipient = ff_getSubmit('mail');
$body= ff_getSubmit('message');

$from = 'lovre.simunovic@crosstec.org';
$fromname = 'YourNameHERE';
$subject = 'YourSubjectHERE';

$badword = array('viagra','sex','milf');

foreach ($badword as $bw)
{
    if (stripos($body, $bw) !== false)
    {
        $send = false;
    }  
} 

if($send === true)
{$this->sendMail($from, $fromname, $recipient, $subject, $body);}

das sieht auch soweit gut aus, allerdings bekomme ich im Frontend leider die Fehlermeldung:
"Ungültige Adresse (addAnAddress to):"

Habe darauf versucht im PHP script die AddAddress() Sache zu integrieren:
$mail->AddAddress($recipient);

leider ohne Erfolg

Bitte um Hilfe bei der Fehlerbeseitigung, damit hier endlich der Spamschutz greift,
habe zuvor bereits einen mittels JS umgesetzt. Der funktioniert ja nur clientseitig.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248583

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi,

not sure, but in your System->Global Configuration->Server -> Mail settings:
which Mailer are you using?
when you click on "Send test mail" do you recive email on your email address?

Also, in this example did you change everything you need with your information?

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by tihana.krivic.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248616

  • Avatar de FiftyNineDesign Autor del tema
  • FiftyNineDesign
  • Fuera de línea
  • Navegador Junior
  • Navegador Junior
  • Registered
  • Mensajes: 74
  • Gracias recibidas: 0
Hi Tihana,
it`s the "PHP Mail" function, which is in use.

This is not about the sending the form,
but it`s about protecting it from getting spammed !

Tihana, please read properly.

After i used the PHP example from above, i got the mentioned PHP error.
That`s the problem.


Parte del mensaje está oculto para usuarios no registrados. Por favor inicie sesión o regístrese para poder verlo.


I need a working example preventing spam with a bad-words-filter via PHP.
That´s it.

And yes, i changed the vars, have a look:
$this->execPieceByName('ff_InitLib');
$send = true;

$recipient = ff_getSubmit('mail');
$body= ff_getSubmit('message');

$from = 'info@galabau-formann.de';
$fromname = 'www.galabau-formann.de';
$subject = 'Anfrage über das Kontaktformular von www.galabau-formann.de';
//$mail->AddAddress($recipient);

$badword = array('viagra','sex','milf','SEO','loan','www','WWW','http','https','HTTP','HTTTPS','google','GOOGLE','com');

foreach ($badword as $bw)
{
    if (stripos($body, $bw) !== false)
    {
        $send = false;
    }  
} 

if($send === true)
{$this->sendMail($from, $fromname, $recipient, $subject, $body);}

Spam is still being send and received with the form today.

PLEASE consider making an Update and integrating such things as preventing spam,
via JS & PHP.

thank you

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by FiftyNineDesign.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248618

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi,

please try this:
$this->execPieceByName('ff_InitLib');
$send = true;

$recipient = ff_getSubmit('mail');
$body= ff_getSubmit('message');


$from = 'info@galabau-formann.de';
$fromname = 'www.galabau-formann.de';
$subject = 'Anfrage über das Kontaktformular von www.galabau-formann.de';


$badword = array('viagra','sex','milf','SEO','loan','www','WWW','http','https','HTTP','HTTTPS','google','GOOGLE','com');

foreach ($badword as $bw)
{
    if (stripos($body, $bw) !== false)
    {
        $send = false;
    }  
} 

if($send === true)
{$this->sendMail($from, $fromname, $recipient, $subject, $body);}

In this part:
$recipient = ff_getSubmit('mail');
Make sure that 'mail' is name of your email element (not title)

Let me know if it helps

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by tihana.krivic.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248626

  • Avatar de FiftyNineDesign Autor del tema
  • FiftyNineDesign
  • Fuera de línea
  • Navegador Junior
  • Navegador Junior
  • Registered
  • Mensajes: 74
  • Gracias recibidas: 0
Hello Tihana,

didn`t help - error still occurs.
Do you like to have a closer look as admin?
How can i send you data, that no-one else could see?

Greetings

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 2 años 8 meses antes #248627

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderador
  • Moderador
  • Registered
  • Mensajes: 12079
  • Gracias recibidas: 786
Hi,

you can use this for your data (only forums moderators can see this)
[confidential]
//your info here
[/confidential]

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Moderadores: ForumSupport
Tiempo de carga de la página: 0.065 segundos

Live Support Chat Opened!

Join our Discord chat here and enter the Crosstec channels to receive live support and talk directly to the team!