Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | How does gmail spam filtering work?

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

Remote IP addy on page?
Reply
 
Thread Tools
Old 18-08-2004, 22:50   #1
altis
Inactive
 
altis's Avatar
 
Join Date: Jun 2003
Location: Warrington ntl:81304 Altitude: 12m (and falling)
Posts: 4,499
altis has a nice shiny staraltis has a nice shiny star
altis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny staraltis has a nice shiny star
Remote IP addy on page?

How can I get the remote IP address onto an HTML page?

I have discovered that, if I change the filename to index.shtml, this switches on SSI and I can use something like the following:

Code:
<a href="mailto:<!--#echo var='REMOTE_ADDR'-->@mysite.co.uk">
This works fine but it generates the address in the usual xx.xx.xx.xx format. I would prefer it as an 8-digit hexadecimal number so as not to put peeps off.

This code also has a problem with NTLs transparent caches since it reports their IP and not the user's. I seem to remember Sir Robin pointing out that the new caches were configured incorrectly.

Any ideas?
altis is offline   Reply With Quote
Advertisement
Old 19-08-2004, 00:16   #2
philip.j.fry
Inactive
 
philip.j.fry's Avatar
 
Join Date: Jul 2003
Posts: 1,395
philip.j.fry has reached the bronze age
philip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze agephilip.j.fry has reached the bronze age
Re: Remote IP addy on page?

I'm not an expert on SSI, but if your web host has php or cgi enabled, you could use these. Fairly similar idea, you get the remote address as a variable, from there you use a conversion function to get the hex then print it back out to the page.
philip.j.fry is offline   Reply With Quote
Old 19-08-2004, 02:41   #3
Paul
Dr Pepper Addict
Cable Forum Admin
 
Paul's Avatar
 
Join Date: Oct 2003
Location: Nottingham
Age: 63
Services: Zen & YouFibre FTTP, Sky Q TV, Sky Mobile, Flextel SIP
Posts: 31,367
Paul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered stars
Paul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered starsPaul is seeing silvered stars
Re: Remote IP addy on page?

Quote:
Originally Posted by altis
This code also has a problem with NTLs transparent caches since it reports their IP and not the user's. I seem to remember Sir Robin pointing out that the new caches were configured incorrectly.

Any ideas?
AFAIK the caches are configured correctly, the client ip is contained in one of two other variables - they (and the variable details) are on this page.
__________________

Baby, I was born this way.
Paul is offline   Reply With Quote
Old 19-08-2004, 04:01   #4
Frank
Inactive
 
Join Date: Jun 2003
Location: Toronto, Canada
Services: Beanfield 50/50 FTTH and iPTV
Posts: 1,756
Frank has a golden auraFrank has a golden auraFrank has a golden auraFrank has a golden aura
Frank has a golden auraFrank has a golden aura
Re: Remote IP addy on page?

I'm not sure how to do this with SSI (or if you can) as it's so old

This can be done very easily on PHP however, just a few line of code to tes the variables and to display them as explained in Paul's link.

E.G.

PHP Code:
<?php
     
if (getenv(HTTP_X_FORWARDED_FOR)) { 
    
//get past a proxy addy
    
$ip=getenv(HTTP_X_FORWARDED_FOR); 
    } else { 
    
//normal ip addy
    
$ip=getenv(REMOTE_ADDR); 
    }
    echo 
"$ip";
    
?>
Some caches did return the IP address backwards at one point, but I believe his was fixed.
Frank 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 06:57.


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