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.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    62
    Member #
    4758
    What is this code supposed to do?

    Code:
    <?php
    
     $ip = getenv("HTTP_HOST");
    
       if ($ip  == "www.website.com" or $ip == "website.com")
    
          {
    
    Header("Location: website/index.html");
    
    exit;
    
      }
    
    ?>
    
    <?php
    
    if ($_GET['server'] == true){
    
              phpinfo();
    
             
    
    }
    
    
    
    ?>
    
    <a href='http://anotherWebsite.com'>Click Here!</a>
    - flipjargendy

  2.  

  3. #2
    ljm
    ljm is offline
    Senior Member ljm's Avatar
    Join Date
    Aug 2006
    Location
    Manchester, England
    Posts
    284
    Member #
    13684
    Liked
    1 times
    It looks like a load of nonsense, really.

    It appears that it's a script to display [phpfunction]phpinfo()[/phpfunction], only with some rather shoddy security. If the IP isn't what the script expects (why it goes off a host name, and not the IP itself I don't know), it'll redirect the page (and then exit, which is pointless since the script would exit after the header is sent). Then, in what seems to be totally unrelated code (shown by closing and reopening tags for no reason), it shows phpinfo() and a link, if a variable in the URL is set to anything (eg. 'example.com/page.php?server=mymumrocks').

    If you were asked to use that code on your server, I wouldn't recommend it.

  4. #3
    Senior Member imagn's Avatar
    Join Date
    Jul 2007
    Location
    Los Angeles
    Posts
    156
    Member #
    15594
    The first part almost looks like a bad attempt at a redirect - though why you'd do this way is beyond me...

  5. #4
    Junior Member intrinzic's Avatar
    Join Date
    Aug 2007
    Posts
    2
    Member #
    15693
    The first set of code checks if the script is located on www.website.com or website.com, if its not then the user will be redirected to website/index.html

    The second set of code checks if $_GET['server'] is set, if it's set then show PHP information.



    ----------
    Web Design E-commerce Web Design Affordable Web Design Services

  6. #5
    Member
    Join Date
    Jan 2004
    Posts
    62
    Member #
    4758
    How would you guys go about redirecting four domain names that are running on the same server? They each have their own directory with an index file.
    - flipjargendy

  7. #6
    Junior Member intrinzic's Avatar
    Join Date
    Aug 2007
    Posts
    2
    Member #
    15693
    Quote Originally Posted by flipjargendy
    How would you guys go about redirecting four domain names that are running on the same server? They each have their own directory with an index file.
    Put this on each of the index files

    PHP Code:
    <?php

    Header
    ("Location: http://www.newlocation.com");

    ?>

  8. #7
    Member
    Join Date
    Jan 2004
    Posts
    62
    Member #
    4758
    Quote Originally Posted by intrinzic
    Put this on each of the index files

    PHP Code:
    <?php

    Header
    ("Location: http://www.newlocation.com");

    ?>
    I'm wondering how to redirect to those those index files though. If someone types in website1.com they are brought to the same location as website2.com would bring them.
    - flipjargendy


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 07:31 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com