Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Hey;

    Would it be possible to make a person viewing my website see a link depending on their I.P address?

    Say user#1 has an I.P of 11.111.111.1, and user#2 has 12.111.111.1 and I specify that anyone with 11.111.111.1 will see the link, then user#1 will see the link on the page, and user#2 wont.

    Get me?

    Thanks
    assassingod - vB.org Moderator :ichatsmile:

  2.  

  3. #2
    Senior Member Rufus's Avatar
    Join Date
    Nov 2002
    Location
    Atlanta, Georgia
    Posts
    115
    Member #
    314
    ummmm...yeah...I bet there is but I'm tired and lazsy....I'll look for it later -_-zZzzZzzzZZZzzz
    "I'm lazy and damn proud of it!"
    - Jordan S. Rains, aka, Me! >_>
    "I saw a car one day, I drove it home, and now the cops are after me for some strange reason."
    - ehem...me again <_<

  4. #3
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    i can show u how to do that in PERL if u want.

    if u want to know how in PHP then i can't help.

  5. #4
    Senior Member Kings's Avatar
    Join Date
    Feb 2002
    Posts
    129
    Member #
    19
    Check if this code works,
    PHP Code:
    // Get ip address
    $IP $HTTP_SERVER_VARS["REMOTE_ADDR"]; 

    // Check which link to display
    if ($IP == "11.111.111.1") {
         
    // Display a link
    } else {
         
    // Display other link

    K i n g s

    Several handy ASP Resources:
    4guysfromrolla | aspin | ASP101 | AspIt | learnasp

    Several handy ASP.NET resources:
    ASP.NET | .NET Experts | O'Reilly .NET | AspIt | 4guysfromrolla

    Several paid ASP/ASP.NET webhosts:
    Brinkster | Maximum ASP | Clicktech | Nodehosting | Uplinkearth | Webhost4life

  6. #5
    Senior Member Rufus's Avatar
    Join Date
    Nov 2002
    Location
    Atlanta, Georgia
    Posts
    115
    Member #
    314
    that should work
    "I'm lazy and damn proud of it!"
    - Jordan S. Rains, aka, Me! >_>
    "I saw a car one day, I drove it home, and now the cops are after me for some strange reason."
    - ehem...me again <_<

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    FWIW it should be $_SERVER; $HTTP_SERVER_VARS is deprecated.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Cheers King and filburt.
    energizze;
    No thanks. Not that I dont want your help its just i'd prefer PHP rather than PERL
    assassingod - vB.org Moderator :ichatsmile:

  9. #8
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    k

  10. #9
    Senior Member assassingod's Avatar
    Join Date
    Nov 2002
    Posts
    112
    Member #
    307
    Thats clearly spam.

    And the code worked great Thanks
    Btw, what if I wanted to let more than 1 user view the link, would the code go like this:
    PHP Code:
    // Get ip address
    $IP $HTTP_SERVER_VARS["REMOTE_ADDR"]; 

    // Check which link to display
    if ($IP == "11.111.111.1,11.111.111.2") {
         
    // Display a link
    } else {
         
    // Display other link

    ?
    assassingod - vB.org Moderator :ichatsmile:

  11. #10
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Originally posted by ffdcsite
    Thats clearly spam.
    What is? (or did nsr81 remove it)
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:48 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com