Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: ip address  (Read 3602 times)

0 Members and 1 Guest are viewing this topic.

steven32collins

    Topic Starter


    Intermediate
    • Experience: Beginner
    • OS: Windows XP
    ip address
    « on: February 06, 2009, 08:15:12 AM »
    is there a html code that can cheak for a cirtain ip address and will forward the computer with that address to awaeb page but people with other ip addresses get sent to the home page
    Everything should be made as simple as possible, but not simpler.
    --Albert Einstein--

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: ip address
    « Reply #1 on: February 06, 2009, 09:48:44 AM »
    You can use PHP.

    Code: [Select]
    <?php

    $ipaddress 
    $_SERVER['REMOTE_ADDR'];

    if (
    $ipaddress == 123.2.64.232// change this to the actuall IP you want checked
    {
      
    header("Location: /secret_area/index.php"); // change to where you want to send them if IP is matched
    }

    else
    {
      exit;
    }

    ?>


    steven32collins

      Topic Starter


      Intermediate
      • Experience: Beginner
      • OS: Windows XP
      Re: ip address
      « Reply #2 on: February 07, 2009, 01:44:13 AM »
      so where do i type the address for where the people with out a matching address go
      Everything should be made as simple as possible, but not simpler.
      --Albert Einstein--

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: ip address
      « Reply #3 on: February 07, 2009, 08:04:32 AM »
      How many IPs are we talking about?

      Code: [Select]
      <?php

      $ipaddress 
      $_SERVER['REMOTE_ADDR'];

      if (
      $ipaddress == 123.2.64.232// change this to the actuall IP you want checked
      {
        
      header("Location: /secret_area/index.php"); // change to where you want to send them if IP is matched
      }

      elseif (
      $ipaddress == 45.232.12.245)
      {
        
      header("Location: index.html");
      }

      ?>


      steven32collins

        Topic Starter


        Intermediate
        • Experience: Beginner
        • OS: Windows XP
        Re: ip address
        « Reply #4 on: February 09, 2009, 10:35:00 AM »
        about 4 or 5
        Everything should be made as simple as possible, but not simpler.
        --Albert Einstein--

        kpac

        • Web moderator
        • Moderator


        • Hacker

        • kpac®
        • Thanked: 184
          • Yes
          • Yes
          • Yes
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 7
        Re: ip address
        « Reply #5 on: February 10, 2009, 12:21:09 PM »
        So, do you know the IPs? If you don't, I'm not sure there is a way to do it.

        Code: [Select]
        <?php

        $ipaddress 
        $_SERVER['REMOTE_ADDR'];

        if (
        $ipaddress == <first IP> || <second IP> || <third IP> || <fourth IP>) 
        {
          
        header("Location: /secret_area/index.php"); // change to where you want to send them if IP is matched
        }

        else
        {
          
        header("Location: /index.htm"); // change to homepage
        }

        ?>