Hi
Im having a problem that appears to be the . in the ipaddress when retrieved using {ip_address} global variable.
I have 2 variables that look identical to the eye:
(125.3.114.233) and
(125.3.114.233)
the first comes from the database and the second is from the {ip_address} global variable.
If i try to remove the dots using php i get
(1253114233) and
(125.3.114.233)
Which leads me to believe that the dots are somehow different. I would like to know how they are different.
{exp:query sql="SELECT field_id_40 AS customers, t.entry_id, t.ip_address as ip FROM ee_weblog_titles AS t, ee_weblog_data AS d WHERE t.entry_id = d.entry_id AND t.weblog_id = d.weblog_id AND t.status ='Pending' AND t.weblog_id='8' AND t.title LIKE 'O;OKING:%' order by t.entry_id DESC limit 0,1"}
e:{entry_id}
c:{customers}
i:{ip}
<?php
$ipAddress = "{ip}";
$currentIP = "{ip_address}";
print "ipaddress:$ipAddress
";
print "currentipaddress:$currentIP
";
$a = trim($ipAddress);
$A = str_replace(".", "", $a);
$b = trim($currentIP);
$B = str_replace(".", "", $b);
if($A==$B){
echo "The IP's match";
}else{
echo "No Ip match: ($A): ($B)";
}
?>
{/exp:query}im getting output like this
ipaddress:125.3.114.233
currentipaddress:125.3.114.233
No Ip match: (125.3.114.233): (125.3.114.233)
when i add the str_replace to remove the dots . and try to just compare the numbers i am unable to remove them from the ipaddress generated using the {ip_address} global variable.
They look like normal dots but i cant get the ip from the database to match the current ip.
Know of any reason this might be happening?
I have tried copying the output dots and substituting them in the str_replace function but that did not fix things.
Thanks