GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Quick Php Question (https://gfy.com/showthread.php?t=958370)

wdsguy 03-14-2010 05:15 PM

Quick Php Question
 
I'm hoping someone can help me with a quick php question:thumbsup

I have the following on my signup

if($ip=getIp()){
if(!in_array($ip,$CFG['skipipcheck'])&&sign_up_check_ip($ip))
error_quit( "You already have an account.");
}


basically it grabs the users signup ip and then checks if it already exists in the system - if it does it will not let them signup.

How would I modify it to check against an array of ips? I want it to check if the users signup ip matches a couple of blacklisted ips and if it does i don't want them to be able to signup.


Thanks

jwerd 03-14-2010 05:20 PM

Quote:

Originally Posted by wdsguy (Post 16946115)
I'm hoping someone can help me with a quick php question:thumbsup

I have the following on my signup

if($ip=getIp()){
if(!in_array($ip,$CFG['skipipcheck'])&&sign_up_check_ip($ip))
error_quit( "You already have an account.");
}


basically it grabs the users signup ip and then checks if it already exists in the system - if it does it will not let them signup.

How would I modify it to check against an array of ips? I want it to check if the users signup ip matches a couple of blacklisted ips and if it does i don't want them to be able to signup.


Thanks

I'm assuming if they are black listed, you don't want to mention to them that they "already have an account" so the easiest way would be an else if:

// above code yada,yada
} else if(in_array($ip, $blacklisted)) {
error_quit("Sorry bud, nice try.");
}

and blacklisted would be an array like $blacklisted = array('192.168.1.1', '192.168.1.2'); etc..

Good luck!

wdsguy 03-14-2010 05:31 PM

Quote:

Originally Posted by lamerhooD (Post 16946127)
I'm assuming if they are black listed, you don't want to mention to them that they "already have an account" so the easiest way would be an else if:

// above code yada,yada
} else if(in_array($ip, $blacklisted)) {
error_quit("Sorry bud, nice try.");
}

and blacklisted would be an array like $blacklisted = array('192.168.1.1', '192.168.1.2'); etc..

Good luck!


thanks :thumbsup

jwerd 03-14-2010 05:56 PM

Quote:

Originally Posted by wdsguy (Post 16946151)
thanks :thumbsup

np glad I could help! :thumbsup

HighEnergy 03-14-2010 06:20 PM

If you check it against dupe IPs you'll may possibly disallow anyone with a dynamic IP. I would check it against your blacklist only.


All times are GMT -7. The time now is 09:14 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123