On my site i want the ip for reference but i have a problem...
i am trying to set the ip as a cookie and it comes out as:
"ip=65%2E32%2E102%2E123"
My code is...
'-------------------------------------------------------
<%
'GET IP
Dim ipaddress
ipaddress = request.servervariables("http_x_for")
if ipaddress <> "" then
theip = ipaddress
else
theip = request.servervariables("remote_addr")
end if
if request.cookies("ip") = "" then
response.cookies("ip") = theip
response.cookies("ip").expires = date() + 365
'End of get ip!
else
end if
%>
'-------------------------------
now when i preview it in browser if i dont include theip step it shows the ip and if i use ipaddress it doesnt... I tried setting it as a cookie and it tells me that the headers are already written to... Where did i go wrong?