-1

I have this function

function getDomain($you){
$domain = substr(strrchr($you, "@"), 1);
$blacklist = array('hushmail.com', 'sharklasers.com', 'guerrillamailblock.com', 'guerrillamail.com', 'guerrillamail.net', 'guerrillamail.biz', 'guerrillamail.org', 'guerrillamail.de', 'spam4.me' 'tagyourself.com', 'getairmail.com', 'broadbandninja.com', 'whatsaas.com', '6paq.com', 'consumerriot.com', '7tags.com', 'moburl.com', 'cellurl.com', 'whatiaas.com', 'vidchart.com', 'rmqkr.net', 'bh.mintemail.com', 'mailcatch.com', 'mailinator.com', 'spamthisplease.com', 'chammy.info', 'sogetthis.com', 'letthemeatspam.com', 'spamhereplease.com', 'sendspamhere.com', 'tradermail.info', 'meltmail.com', 'yopmail.fr', 'yopmail.com', 'yopmail.net', 'fakeinbox.com', 'emailsensei.com', 'insorg-mail.info', 'mailnesia.com', 'tempsky.com', 'freemail.ms', 'mailexpire.com', 'jetable.org', 'mailmetrash.com', 'inst1.com', 'inbox.si', 'armyspy.com', 'dayrep.com', 'teleworm.us', 'tempemail.net', 'throwawaymail.com', 'sofimail.com', 'tempinbox.com', 'dingbone.com', 'fudgerub.com', 'lookugly.com', 'smellfear.com', 'shitmail.com', 'crapmail.com', 'moto-technika71.com', 'blizzardrc.org', 'tyear.ru', 'autostop71.ru', 'anonymouss.ws', 'coupe-cars.ru', 'mytempemail.com', '0clickemail.com', 'utilities-online.info', 'emailisvalid.com', 'hushmail.me', 'hush.com', 'hush.ai', 'mac.hush.com', 'incognitomail.org', '12minutemail.com', 'deadaddress.com');
if (in_array($domain, $blacklist)) {
    return true
} else {
    return false
}
}

I am using it to make sure that people aren't using disposable e-mail addresses when they sign up for a website, but for some reason when I add this in, it breaks the entire script, I have went over several times and I cannot for the life of me figure out the typo/mistake I have made. It is probably something very simple, but my eyes just cannot find it.

kira423
  • 325
  • 1
  • 5
  • 26
  • 4
    missing semi-colons after both return statements. – Daedalus Mar 27 '13 at 16:22
  • A blank page means that your script is throwing an error but you haven't configured PHP to display error messages. That's something you need to fix before you go further; it's impossible to code without the aid of error messages. Here's a [brief explanation](http://stackoverflow.com/a/5680885/13508). – Álvaro González Mar 27 '13 at 16:23
  • @Daedalus please post as an answer, I feel kind of silly now, but I really appreciate it. – kira423 Mar 27 '13 at 16:24
  • @ÁlvaroG.Vicario I know all about error messaging thanks for the tip though. – kira423 Mar 27 '13 at 16:24
  • Missing comma between 'spam4.me' and 'tagyourself.com' – Daedalus Mar 27 '13 at 16:24
  • Just so everyone is clear, I do have error logs, and I do know how to use them. The question was where my typo was, not why I had no error when I did. – kira423 Mar 27 '13 at 16:26
  • @kira423 - Do you mean that you got the parse error but preferred not to say? – Álvaro González Mar 27 '13 at 16:28
  • @ÁlvaroG.Vicario Pretty much, I didn't see the point in telling everyone "Yeah I got an error" When common sense says, "Oh yeah if there is a typo it must be throwing an error." But no sense in getting worked up over it, the problem is fixed and that is all that matters. – kira423 Mar 27 '13 at 16:30
  • 1
    @kira423 - Error messages have a purpose: to help diagnose issues. Don't disregard them as irrelevant! – Álvaro González Mar 27 '13 at 16:38

2 Answers2

3

(1) Missing ; after return statements

(2) Missing , between 'spam4.me' and 'tagyourself.com'

Daedalus
  • 1,667
  • 10
  • 12
2

You are missing a comma here: 'spam4.me' 'tagyourself.com'

And then semicolons in both return lines.

Though you should activate PHP error log.

alxgb
  • 543
  • 8
  • 18