TOPIC:

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 1 day ago #248577

  • FiftyNineDesign's Avatar Topic Author
  • FiftyNineDesign
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 61
  • Thanks: 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.

Please Log in or Create an account to join the conversation.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 1 day ago #248583

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 1662
  • Karma: 3
  • Thanks: 149
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

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 20 hours ago #248616

  • FiftyNineDesign's Avatar Topic Author
  • FiftyNineDesign
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 61
  • Thanks: 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.


Part of the message is hidden for the guests. Please log in or register to see it.


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

Please Log in or Create an account to join the conversation.

Last edit: Post by FiftyNineDesign.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 20 hours ago #248618

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 1662
  • Karma: 3
  • Thanks: 149
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

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 18 hours ago #248626

  • FiftyNineDesign's Avatar Topic Author
  • FiftyNineDesign
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 61
  • Thanks: 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

Please Log in or Create an account to join the conversation.

Spamschutz via PHP: Ungültige Adresse (addAnAddress to): 4 weeks 18 hours ago #248627

  • tihana.krivic's Avatar
  • tihana.krivic
  • Away
  • Moderator
  • Moderator
  • Posts: 1662
  • Karma: 3
  • Thanks: 149
Hi,

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

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.054 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!