Jump to content

Recommended Posts

I have the following code on a page for a good while and until recently it has been working fine.

 

<?php

    echo GetHostByName($REMOTE_ADDR) . " - ip<br>";
    echo GetHostByName($HTTP_ACCEPT_LANGUAGE) . " - lang<br>";
    echo GetHostByName($HTTP_REFERER) . " - ref<br>"; 
    echo GetHostByName($HTTP_USER_AGENT) . " - agent<br>";
    
  //~ // Collect forwarder information
    $forwarded1 = getenv(HTTP_X_FORWARDED_FOR);
    $forwarded2 = $HTTP_X_FORWARDED_FOR;
    $forwarded3 = GetHostByName($HTTP_X_FORWARDED_FOR);
   
    if ($forwarded1 != null) { $forwardCom .= $forwarded1; }
    if ($forwarded2 != null) { $forwardCom .= " | $forwarded2"; }
    if ($forwarded3 != null) { $forwardCom .= " | $forwarded3"; }
      if ($forwardCom == null) { $forwardCom = "No data"; }

  echo "$forwardCom | $forwarded1 | $forwarded2 | $forwarded3";
?> 

 

The page didn't output the information as the example does, but the above code still processes very slowly.

 

The idea is to collect this information to store in a database, however for some reason the code now seems to lag the page so much that the browser sometimes even attempts to download the .php page, and nothing else on the page is executed correctly.

 

I am sure that the Web host has not updated PHP (its a 3rd party one and they are running PHP 4.x), though if anyone else knows something that could have been updated that would effect this, then please let me know.

 

Anyhow, is there something wrong with the way I collect the information, is there a better way, or is some of it really of no use, or generally why all of a sudden does it not work?

 

Would appreciate any insight into this.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.