check to see if an email given contains certains a phrase

the mail() function

Moderators: egami, macek, gesf

Post Reply
diveability
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Apr 06, 2020 5:37 am

Mon Mar 22, 2021 5:34 am

Hi

I keep getting spam from my contact form http://www.art86.org/contactus.php where the sender is inserting something like bendfgfsd@art86.org.

I've looked for a way of comparing the &youremail string given to see if it contains 'art86.org' and, if so, reject it with an error message but cannot find out how to compare part of the string to do this.

Any suggestions would be helpful please

Thanks
User avatar
Strider64
php-forum GURU
php-forum GURU
Posts: 407
Joined: Sat Mar 23, 2013 8:24 am
Location: Livonia, MI
Contact:

Mon Mar 22, 2021 7:00 am

diveability wrote:
Mon Mar 22, 2021 5:34 am
Hi

I keep getting spam from my contact form http://www.art86.org/contactus.php where the sender is inserting something like bendfgfsd@art86.org.

I've looked for a way of comparing the &youremail string given to see if it contains 'art86.org' and, if so, reject it with an error message but cannot find out how to compare part of the string to do this.

Any suggestions would be helpful please

Thanks
Yeah, use https://www.google.com/recaptcha/about/
Life is a fig newton of your imagination! https://www.miniaturephotographer.com
diveability
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Apr 06, 2020 5:37 am

Mon Mar 22, 2021 10:10 am

Strider64 wrote:
Mon Mar 22, 2021 7:00 am
diveability wrote:
Mon Mar 22, 2021 5:34 am
Hi

I keep getting spam from my contact form http://www.art86.org/contactus.php where the sender is inserting something like bendfgfsd@art86.org.

I've looked for a way of comparing the &youremail string given to see if it contains 'art86.org' and, if so, reject it with an error message but cannot find out how to compare part of the string to do this.

Any suggestions would be helpful please

Thanks
Yeah, use https://www.google.com/recaptcha/about/
I'm already using a captcha to stop bots. What I need to do is somehow examine the $youremail string, that the sender enters, and, if it contains my website eg ????@art86.org, then the code intercepts it and sends a Fail to send message to the originator.

If someone could help with the code to do this that would be great thanks
Post Reply