Solved

php login restrict domain registration

Posted on 2014-10-12
4
111 Views
Last Modified: 2014-10-17
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";
		}else{ 
		echo "stop them from signing up";
		}

Open in new window

0
Comment
Question by:Geektank
  • 3
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 40375987
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.
0
 

Author Comment

by:Geektank
ID: 40376040
it's OK I solved this Dave.
0
 

Accepted Solution

by:
Geektank earned 0 total points
ID: 40376044
if (strpos($_POST['user_email'],'example.com') !== false || strpos($_POST['user_email'],'example2.com') !== false) {

Open in new window

0
 

Author Closing Comment

by:Geektank
ID: 40386233
This worked
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now