1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="de_DE" lang="de_DE" xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
$regs="";
$ip = $_SERVER[REMOTE_ADDR];
?>
<script src="http://myip-ipv6.domain.de" type="text/javascript"></script>
<script src="http://myip-ipv4.domain.de" type="text/javascript"></script>
<script language="javascript">
function start(){
ip4 = ipv4();
ip6 = ipv6();
}
</script>
</head>
<body onLoad="start();">
if (ereg("^(222.20.(1[6-9][0-9])|172.16.0).[0-9]{1,3}$",$ip, )) {
?>
<div id="v4"></div>
<br>
<?php
}
elseif (ereg("^(20D2:408((:[a-f0-9]{0,4}){1,6}))$",$ip, $regs)) {
?>
v6 <div id="v6"><b>Zur richtigen Anzeige dieser Seite wird Javascript benötigt!</b></div>
v4 <div id="v4"></div>
<?php
}
?>
1
2
3
4
5
6
7
<?php
$ip = "Ihre IPv4-Adresse lautet: $_SERVER[REMOTE_ADDR]";
echo "function ipv4()
{
document.getElementById('v4').innerHTML = '$ip';
}";
?>
1
2
3
4
5
6
7
<?php
$ip = "Ihre IPv6-Adresse lautet: $_SERVER[REMOTE_ADDR]";
echo "function ipv6()
{
document.getElementById('v6').innerHTML = '$ip';
}";
?>