Today Posts Today Posts
Recent Affiliate Payments
Recent Forum Posts
SHOW: 5 | 8 | 10
  • Affiliate Program
  • Payment Date
  • Payment Method
  • Slotland Affiliates
    Feb 2nd
    Moneybookers
  • Rewards Affiliates
    Feb 2nd
    Neteller
  • Rewards Affiliates
    Feb 2nd
    Moneybookers
  • AffActive
    Feb 2nd
    Neteller
  • Intertops
    Feb 2nd
    Casino Account
Enter Your Recent Payments

+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Danny is offline Affiliate Guard Dog Member
    Join Date
    May 2008
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default OMG - Spam on my new site

    My is not even index by google and I got so much spam already. I check my comment table and I saw that their ip_numbers (not ip_address) are 0s (zero).

    I used ip2long to convert the ip_address to ip_number {ip2long($_SERVER['REMOTE_ADDR'])}.

    How come their IPs are 0s?



    Code:
    Hi everyone. Great site. Hold on.
    cosmetics cosmetics cosmetics cosmetics cosmetics cosmetics cosmetics cosmetics 
    cPanel®cPanel®cPanel®cPanel®cPanel®cPanel®cPanel®cPanel®cPanel®cPanel®
    Last edited by Danny; 05-21-2008 at 05:01 AM.

  2. #2
    Guard Dog's Avatar
    Guard Dog is offline Guard Dog
    Join Date
    Dec 2006
    Location
    Wisconsin
    Posts
    4,520
    Thanks
    1,259
    Thanked 2,201 Times in 1,140 Posts
    Blog Entries
    1

    Default

    I am not sure why you would want to convert the IP address to a long data type? Wouldn't you want to see it as xxx.xxx.xxx.xxx?

    Regardless, the following should work


    PHP Code:
    $referrer_ip getenv(REMOTE_ADDR); 
    $ip_address =ip2long($ip); 
    Or, if you are on versions of php earlier than 5.0:

    PHP Code:
    $remote_ip getenv(REMOTE_ADDR); 
    $ip_extract explode (".",$remote_ip);
    $code=($ip_extract[0] * 16777216) + ($ip_extract[1] * 65536) + ($ip_extract[2] * 256) + ($ip_extract[3]); 

    If you want to see it as xxx.xxx.xxx.xxx, then:

    PHP Code:
    $referrer_ip getenv(REMOTE_ADDR); 

    If you want to grab each octet of the IP address:

    PHP Code:
     $remote_ip getenv(REMOTE_ADDR); 
    $ip_extract explode (".",$remote_ip);


    $octet1 $ip_extract[0];
    $octet2 $ip_extract[2];
    $octet3 $ip_extract[3];
    $octet4 $ip_extract[4]; 

    I hope that helps

  3. #3
    Danny is offline Affiliate Guard Dog Member
    Join Date
    May 2008
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The reason I am using ip2long is because I implemented maxmind ip-country database on my system.

    maxmind using ip number instead of ip address. So I like to use ip number as well for the ease and robustness of comparison.

    There shouldn't be any problem as my server uses the latest version of PHP. But, I'll try your method.

    I also need to implement captcha to minimize the spamming.

  4. #4
    Guard Dog's Avatar
    Guard Dog is offline Guard Dog
    Join Date
    Dec 2006
    Location
    Wisconsin
    Posts
    4,520
    Thanks
    1,259
    Thanked 2,201 Times in 1,140 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Danny View Post
    The reason I am using ip2long is because I implemented maxmind ip-country database on my system.

    maxmind using ip number instead of ip address. So I like to use ip number as well for the ease and robustness of comparison.

    There shouldn't be any problem as my server uses the latest version of PHP. But, I'll try your method.

    I also need to implement captcha to minimize the spamming.

    I don't know why it wouldn't work, then... I would do an echo of the 'REMOTE_ADDR', then, to see if the problem starts there. There is a breakdown somewhere and it is either in the function or in the IP address itself.

  5. #5
    Danny is offline Affiliate Guard Dog Member
    Join Date
    May 2008
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Look, my ip address/number is shown correctly. I even try different IPs. I don't know why their ips doesn't shown!

  6. #6
    Guard Dog's Avatar
    Guard Dog is offline Guard Dog
    Join Date
    Dec 2006
    Location
    Wisconsin
    Posts
    4,520
    Thanks
    1,259
    Thanked 2,201 Times in 1,140 Posts
    Blog Entries
    1

    Default

    Here's a little function I found that might help you out:

    PHP Code:
    function GetIP()
    {
       if (
    getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
               
    $ip getenv("HTTP_CLIENT_IP");
           else if (
    getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
               
    $ip getenv("HTTP_X_FORWARDED_FOR");
           else if (
    getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
               
    $ip getenv("REMOTE_ADDR");
    else if (isset(
    $_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
               
    $ip $_SERVER['REMOTE_ADDR'];
           else
               
    $ip "unknown";
       return(
    $ip);

    Now use the GetIP() function to return the IP and then convert it to a long data type.

  7. #7
    bonustreak's Avatar
    bonustreak is offline Super Moderator
    Join Date
    Dec 2006
    Posts
    2,210
    Thanks
    1,510
    Thanked 971 Times in 535 Posts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts