Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-14-2010, 05:15 PM   #1
wdsguy
Ryde or Die
 
Industry Role:
Join Date: Dec 2002
Location: California-Shanghai
Posts: 19,568
Quick Php Question

I'm hoping someone can help me with a quick php question

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
wdsguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-14-2010, 05:20 PM   #2
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by wdsguy View Post
I'm hoping someone can help me with a quick php question

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!
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-14-2010, 05:31 PM   #3
wdsguy
Ryde or Die
 
Industry Role:
Join Date: Dec 2002
Location: California-Shanghai
Posts: 19,568
Quote:
Originally Posted by lamerhooD View Post
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
wdsguy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-14-2010, 05:56 PM   #4
jwerd
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
Quote:
Originally Posted by wdsguy View Post
thanks
np glad I could help!
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-14-2010, 06:20 PM   #5
HighEnergy
So Fucking Banned
 
Join Date: Apr 2007
Posts: 806
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.
HighEnergy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.