• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How to block gmail/ymail/hotmail from submitting

How to block gmail/ymail/hotmail from submitting 10 years 11 months ago #22779

Hi there, I am building a form for a clients website who only wants people from professional organisations to fill out their forms, and so does not want to receive submissions from people with gmail / yahoo / hotmail email addresses.

How do I achieve this please? I am guessing I need to enter an extra bit of code into the validation.php file but I am completely useless when it comes to php!

Please help!

Thanks very much,

Keith
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 10 years 11 months ago #22784

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try using the $invalid method as explained here:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html

Example:

$array = array('yahoo','gmail','hotmail');

foreach($array as $arr){
if(strpos("@".$_POST, $arr))
$invalid[] = RSFormProHelper::getComponentId("your_email_field_name");
}
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 9 years 5 months ago #29299

  • modiac
  • modiac's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Hello,

This is what been tried in Script called on form process


$array = array('yahoo','gmail','hotmail','rediffmail');


Try - 1
foreach($array as $arr){
if($_POST == $arr)
$invalid[] = RSFormProHelper::getComponentId('Email');
}

Try - 2
foreach($array as $arr){
if(strpos("@".$_POST, $arr))
$invalid[] = RSFormProHelper::getComponentId("Email");
}

where Email is the field name

But - the script doesnt seems to work in 2.5.x version in rsform pro latest version in both try 1 & try 2 (Stating doesnt work means - its not validating as users can still register basis yahoo / gmail / hotmail addresses)
Is there any change need to be done for blocking registration from above email ids, pl suggest
Last Edit: 9 years 5 months ago by modiac.
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 9 years 5 months ago #29337

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Within the same scripting area, you can try using this instead:
$array = array('yahoo','gmail','hotmail','rediffmail');
 
foreach($array as $arr){
	if(strpos("@".$_POST['form']['Email'], $arr)){
		$invalid[] = RSFormProHelper::getComponentId('Email');
	}
}
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
The following user(s) said Thank You: jjspelman

How to block gmail/ymail/hotmail from submitting 9 years 5 months ago #29381

  • modiac
  • modiac's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 7
Thanks it works Awesome !!
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 7 years 9 months ago #35358

  • dryfive
  • dryfive's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Is it possible to use this for multi-page forms? It works when testing on a standard form, but when trying it on a multi-page form where the email is entered on the first page/step, it doesn't seem to work when clicking 'Next'...
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 4 years 5 months ago #39618

i am trying to apply this script on version Pro 2.1.0 but it does not work, any help someone?
The administrator has disabled public write access.

How to block gmail/ymail/hotmail from submitting 3 years 3 months ago #40863

  • prakash2
  • prakash2's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
How to use popup Error message?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!