close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Security assist help

Thread began 10/06/2014 11:40 am by russb335115 | Last modified 10/09/2014 11:37 am by Jason Byrnes | 618 views | 13 replies |

russb335115

Security assist help

Is it possible to prevent certain email address from registering on a website?

Example: I don't want anyone with an @yahoo.com or @gmail.com to be able to register as a user.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

you could hand code a check for the email address filed:

<?php
if(isset($_POST['email'])) {
$emailArray = explode("@", strtolower($_POST['email']));
if(is_array($emailArray)) {
if(in_array("yahoo.com", $emailArray) || in_array("gmail.com", $emailArray)) {
header("Location: pageName.php?badDomain=true");
}
}
}
?>



this will redirect to page called pageName.php with a badDomainURL variable
pageName.php?badDomain=true"

use an if statement to show an error message if the bad domain uRL = true:
<?php if(isset($_GET['badDomain']) && $_GET['badDomain'] == "true" ) { ?>nope<?php } ?>

you can of course edit the page name in the code.

Sign in to reply to this post

russb335115

Great,

Thank you Jason,

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

russb335115

This code goes on the register page?

The first part goes before the Head tag?

The second part is attached to the email field?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, the first part goes at line 1, the second snippet where you want the error to display.

Sign in to reply to this post

russb335115

Well I think I have it right but not getting the results. If you have a moment can you check it out: (see pm)

Sign in to reply to this post

Jason ByrnesWebAssist

on your page the name of the email element is:
Registration_group_4_Email

did you edit the code to use the correct form element name?


you will need to change:
$_POST['email']

to:
$_POST['Registration_group_4_Email']

Sign in to reply to this post

russb335115

Still not working, do I need to also change this: $_POST['Registration_submit']

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...