Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | integrating Joomla, Coppermine and SMF... urgh.

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion
Register FAQ Community Calendar

PHP Page Logging Problem
Reply
 
Thread Tools
Old 24-10-2005, 21:03   #1
Tricky
Inactive
 
Tricky's Avatar
 
Join Date: Jun 2003
Location: I am house...
Services: $KY+HD - BT Infinity
Posts: 2,284
Tricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful one
PHP Page Logging Problem

I have a script "logger.php" which includes the following code:
PHP Code:
if ($HTTP_VIA)
        {
            *****
proxy = "Y";
            if (
strpos($HTTP_X_FORWARDED_FOR,',')) 
            { 
                
$HTTP_X_FORWARDED_FOR = substr($HTTP_X_FORWARDED_FOR,0,strpos($HTTP_X_FORWARDED_FOR,',') ); 
            }
            *****
addy = $HTTP_X_FORWARDED_FOR;
            if(*****
addy == "")
                *****
addy = getenv("REMOTE_ADDR");                    
        }
        else
        {
            *****
proxy = "N";
            *****
addy = getenv("REMOTE_ADDR");
        } 
If I execute the script standalone it returns:
proxy = Y and hitaddy is my "REAL" IP address

If I include the script in another file (HTML) with:
PHP Code:
<?PHP include "/logger.php"; ?>
It returns
Proxy = N and the hitaddy is the "PROXY" NTL one!

Why? and how do I fix it!?
Tricky is offline   Reply With Quote
Advertisement
Old 24-10-2005, 21:40   #2
Graham M
Inactive
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 41
Services: FreeSat+ Tivo V-Box VM 60MBit
Posts: 13,365
Graham M has a pair of shiny starsGraham M has a pair of shiny stars
Graham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny starsGraham M has a pair of shiny stars
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
Re: PHP Page Logging Problem

What happens if you put the snippit of code directly into the new page?
Graham M is offline   Reply With Quote
Old 24-10-2005, 22:41   #3
Tricky
Inactive
 
Tricky's Avatar
 
Join Date: Jun 2003
Location: I am house...
Services: $KY+HD - BT Infinity
Posts: 2,284
Tricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful one
Re: PHP Page Logging Problem

It works - Just noticed that the profanity checker has blanked my code!! the ***** is really $ hits without the space!!!

running the code alone sets the values correctly as in my 1st post
Tricky is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 16:22.


Server: lithium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum