Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

php login restrict domain registration

Hi all,

I've been using this for a login for my clients.

http://www.php-login.net |  >>> Advanced version.

However I need to restrict the domain registration to only their company names...

I have the following however have no idea where to implement the code to...

		$access_list = array('example1.com', 'example2.com');

		$domain = substr(strrchr($user_email, "@"), 1); //extract domain name from email

		if (in_array($domain, $access_list)){ 
		echo "You are good to go";
		echo "stop them from signing up";

Open in new window

  • 3
1 Solution
Dave BaldwinFixer of ProblemsCommented:
Whether that works or not, you are essentially taking their word for the domain.  Do you send an email to the email used for signup to complete the registration?  That would be something to verify that it is legitimate.
GeektankAuthor Commented:
it's OK I solved this Dave.
GeektankAuthor Commented:
if (strpos($_POST['user_email'],'example.com') !== false || strpos($_POST['user_email'],'example2.com') !== false) {

Open in new window

GeektankAuthor Commented:
This worked

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now