?
Solved

php login restrict domain registration

Posted on 2014-10-12
4
Medium Priority
?
122 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 84

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

752 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