Close window

View/Add Web Comments

62 previous comments
For Web page: http://www.hashemian.com/tools/visitor-IP.htm
Add your comment

by: rh [admin]Site Admin on 2009-09-18 13:29:57
read here: http://www.hashemian.com/blog/2007/08/ip-address-and-host-name-scripts.htm
by: Tech on 2009-09-17 18:00:01
What is the php script that is used to feed the IP to the JavaScript?
by: kh again! on 2009-07-22 04:21:44
solved the firefox problem. I had to add an Id label to the text fields. I set the name and Id as the same.
<input name="ip" id="ip" size="75" type="hidden">
<script type="text/javascript">
document.getElementById("ip").value=VIH_HostIP; </script>

<input name="host" id="host" size="75" type="hidden">
<s

by: kh on 2009-07-21 22:50:39
and lastly
Why does this not work in Firefox?
Any fixes to my code?

by: kh on 2009-07-21 22:38:19
noticed my second item was truncated. Here it is
<input
name="host" size="75" type="text">
<script language="JavaScript">
document.getElementById("host").value=VIH_HostName; </script>

by: kh on 2009-07-21 22:30:57
Also - must include the original javascript in the body. Can be hidden.

For the html fields, change
type="text" to
type="hidden"

if you want the fields to be invisible, but still be emailed to you.

by: kh on 2009-07-21 22:28:35
This works on IE 8.06001, not on Firefox 3.0.11

<input name="ip" size="75"
type="text">
<script language="JavaScript">
document.getElementById("ip").value=VIH_HostIP; </script><input
name="host" size="75" type="text">
<script language="JavaScript">
document.getElementById(&q

by: kh on 2009-07-21 21:35:44
I think I got it. Will post the results later!
by: kh on 2009-07-21 19:52:19
I am trying to get the IP and Host into a html form field. I read what you said to Mary Tauber
document.getElementById("hfield").value=VIH_HostIP;

But i need more info.
Where do I paste the above code?
Or is there another way to do it.

PS - live your script - at least I can see my own IP and Host - have looked for two days to get that far!

by: harish on 2009-06-04 08:01:04
this information is very helpful for me. I have <a href="http://webdesigningcompany.net/">design a website</a>. This is very useful for me because I want to display the ip address of the visitors on the my website. so that this information is very helpful for me.
by: rh [admin]Site Admin on 2009-06-03 02:43:38
not possible. at least not with pure javascript. discovering user's ip is the realm of the server-side, ssi or server script.
by: AlexNY on 2009-06-02 13:20:37
is it possible to redirect the user based on his/her IP by javascript and HOW??
by: Vardant on 2009-06-01 03:39:29
I used it in my proxy site www.Vardant.com
by: Dragusha on 2009-05-28 11:10:08
I have used in my website www.Dragusha.net
by: Russ on 2009-04-07 13:57:12
I like it - Thank you
by: Pieter on 2008-12-22 08:08:43
Any ideas on how I can get the IPv6 address instead of the IPv4 adress ?
by: Tony Nailz on 2008-09-15 14:54:35
is there any way that you can record the results to your database and deny access to those whos ip is on the list?

for example:
a visitor visits a specific page on my site, their ip gets recorded; and as long as it's on my database, they can't access the page with ip recorder on it.("just a thought")

BTW. this is a great code.. Kudos to you my friend...

by: Iswandi on 2008-09-01 05:56:36
You can see it in www.geocities.com/iwede
by: Iswandi on 2008-09-01 05:52:49
Thanks man, I use your code and it works just as I desire
by: Hello, World on 2008-07-01 21:18:57
Whats this about??!!
by: Iswandi on 2008-06-28 06:21:33
I use a *.js file to support my html code. How can I put that code into the js file. I have removed the "<script language="Java....></script>", but not work.
Thanks.

by: mimi on 2008-06-10 06:16:35
is it possible to redirect the user if the hostname is "XXXX.abcd.net" by javascript??

I've tried
<script language="JavaScript">
if (VIH_DisplayFormat=="XXXX.abcd.net")
{
location= "www.google.com"
}
</script>

it's not work..

by: Ravi on 2008-05-26 07:30:42
Hi Thanks for your excellent code!!!
I tried to assign Host Ip into a text box. It is coming, but I had to call your php file begining. but the thing is when I even used VIH_DisplayOnPage = no; IP & Host are Displaying.(as follows)

You are visiting from:
IP Address: 168.xxx.xxx.xxx
Host: 168.xxx.xxx.xxx
Can u please help me to hide those IP & Host lines.
Thanks

by: rh [admin]Site Admin on 2008-05-15 03:38:58
that data is generally derived by running a whois on an ip. it generally resolves to isp's location, not an individual's address.
by: Webmaster Trainee on 2008-05-11 06:30:58
Is it possible to display IP Address and also the owner info? I saw once at a website a complte info like this: "Your IP Address is XXX.XX.XX.XX. Your location is "369 W Street, Big City, ANYWHERE. Anybody can help me. I am a webmaster's assistant and still leanr a lot. Thank you for your information.
by: kim on 2008-04-09 13:44:54
is there a way to figure out who an IP address belongs to? and does the ip address change if your logged onto a cell phone when you view a page?
by: hsw on 2008-03-16 02:21:52
are you serius?
IP address is threated as constants in your .js code, how come?

by: N.S. on 2008-02-29 22:05:11
<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"><

by: nightstalker on 2008-02-29 22:04:37
ugh it not wanting me 2 post it.
by: rh [admin]Site Admin on 2008-02-14 02:53:21
use javascript. e.g. if the id of the hidden field is "hfield" use this code:
document.getElementById("hfield").value=VIH_HostIP;

by: Marv Tauber on 2008-02-13 18:47:30
How would I pass the contents of VIH_HostIP to a hidden text field
by: rh [admin]Site Admin on 2008-01-20 03:38:19
ellis, script has been modified to generate javascript variables and suppress the default message. look above for usage.

steve, the script requires server-side code to work. i have provided a link to a blog entry detailing the server-side work.

by: Steve on 2008-01-19 03:46:59
I've searched high and low for a script to identify visitors to my webpage, not to keep track, but to make visitors aware that they're not really completely anonymous. Nothing has actually worked except your script. I'd like to decrease the load on your server but would need your php src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"
but when I try to navigate there I get redirected to a sample usage page but n

by: Ellis on 2008-01-13 18:15:49
Is there a way the IP address can be extracted into a local javascript variable?
by: ayodeji on 2007-12-25 05:50:09
hi pls how do i get this code for use on my site
by: newt on 2007-12-20 12:41:16
How do i get the source file for this, script couse i will need t run everything from my server?
by: christian on 2007-12-12 09:44:26
very nice work.
i really searched baddly for a visitors ip address code.
yours is really deamn good.

now to my last question.
where can i add <align right> so that the text... is wrriten from the right to the left ?

i tried almost everything in:
VIH_DisplayFormat = "..."

but... nothing really works

by: rh [admin]Site Admin on 2007-11-19 02:37:05
wrap the last line of the script block in a <div> or <span> tag and style as desired.
by: jay on 2007-11-16 18:15:09
hey admin
i would like to change the font and i really need to!!! how can i do this?

by: rh [admin]Site Admin on 2007-08-20 02:15:59
as promised, IP address and Host name server-side scripting:

http://www.hashemian.com/blog/2007/08/ip-address-and-host-name-scripts.htm

enjoy

by: rh [admin]Site Admin on 2007-08-10 03:58:11
as some are still skeptical of the intentions of this site (no hard feelings), i will soon post new material on how the IP and host data can be retrieved using various server-side techniques. stay tuned.
by: David on 2007-08-09 14:19:19
Here's a good site with more detail of js's script:
http://www.plus2net.com/php_tutorial/php_ip.php
Don't forget to add <?php before and ?> after.
No phone home with this one.

by: Bill on 2007-08-06 20:36:46
nice work! I know there is a way to do the following, but I have very limited knowledge of javascript, so thats why im asking: How can i log the user's IP and host hidden(ly)? After this I simply name the variables and identify them as well as the other information in my PHP mailto page. This would be very helpful, and I appreciate in advance any replies!
by: John collins on 2007-08-05 03:43:35
Very nice script. Works quite well.

J Collins
www.Ultimate-Anonymity.com

by: hamid on 2007-07-21 19:17:35
hi
i want source code to find visitor ip address other website
example :
get visitor ip www.hashemian.com

by: gabor on 2007-07-05 15:04:01
sal pls ma ajuii sa fac un sever de cs.16 plss??:(
by: rh [admin]Site Admin on 2007-06-26 22:56:23
not so hard to figure that out. the script, coming
from scripts.hashemian.com, is in plain sight up above. and the php code is given just below your comment. no private info is transmitted, and i do nothing with the ip address. feel free to use this utility or call it ratty.

by: js on 2007-06-26 06:02:05
Kind of ratty the way this script phones home to your web site whenever it is used, eh?

BTW, to display the IP address using PHP without the text box, use:

<?= $_SERVER['REMOTE_ADDR'] ?>

by: rh [admin]Site Admin on 2007-06-16 16:35:26
tina, that's not easily done using this utility. but it's simple if you have access to ssi or scripting. e.g. if php is available, you would specify:
<input type="text" value="<?= $_SERVER['REMOTE_ADDR'] ?>">

hth

by: Tina on 2007-06-13 05:14:04
hello, i just wondering if how can i get the %%IP%% or the %%HOST%% to be place in an input box?

<input type="text" value=%%IP%%>

tnx

by: Sanjeet on 2007-04-26 09:01:27
Yo man ! ya did a cool piece of work. Ya deserve every best wishes !!!
by: Hassan on 2006-10-10 01:21:04
Thanks alot friend. Your web site has been a pleasure to visit.Keep UP the good work.
Kheily mamnoon.

by: sacred0m on 2006-09-19 16:26:36
YOu fuckin rock Hashemian! Neat script worx great!

i like to let my visitors know their own info =)

by: rh [admin]Site Admin on 2006-09-15 01:43:28
the data is not logged anywhere. to see such information, you can ask your hosting vendor to provide you with a log of the visits, or you can try one of the several tracking utilities available online, such as google analytics.
by: one feather on 2006-09-09 02:23:27
This code shows the viewer "THEIR" own ip address, but does it log it somewhere so I can view who has visited? (for purposes of bandwidth/graphics stealing?)
by: Nitrogen on 2006-07-20 22:12:45
Hi,
Is it possible to supply a simple js file with a variable string?
Example: <script src="jsfile.js?var=IPString"></script>
<script>alert(IPString)</script>

That script would then popup with my IP address, this would be great to keep users banned off my chatroom :) I would appreciate this, and your name would be mentioned on the frontpage.
-Nitrogen

by: rh [admin]Site Admin on 2006-04-05 02:09:26
new additions are in the plans, but that's it for now.
by: AlohaJoe on 2006-03-31 05:07:20
Hello
besides IP and Host what other items can be shown to the client? and then how to insert them? Ive tried Host_port but it does not show up. Newbie here :-)

thanks
joe

by: AlohaJoe on 2006-03-31 05:02:18
Hello
besides IP and Host what other items can be shown to the client? and then how to insert them? Ive tried Host_port but it does not show up. Newbie here :-)

thanks
joe

by: rh [admin]Site Admin on 2005-12-25 03:17:20
script has been updated to check for HTTP_X_FORWARDED_FOR first. if this value is not set then the actual ip is displayed. please note that some proxy servers may not supply this value for anonymity. in that case the ip address displayed is that of the proxy and not the original one.
by: rh [admin]Site Admin on 2005-11-11 04:38:12
%%IP%% indicates the address where a page is being accessed from. yes, that could be the address of a proxy server or a gateway/firewall. that is a valid request and i might consider enhancing this utility to display data from various headers such as the one requested.
by: Nyi Htut on 2005-10-24 09:49:39
I think %%IP%% is for proxy address.

How can i add X_Forward_Address insted of IP address?

Submit a comment:

Your Name:
*

Your E-mail: (Not shown. No notification is sent.)

Your Web Page URL:

Your Comment: (Max 450 chars, HTML tags are encoded for security.)
*
 characters left.
Type in the code you see: No zero used [what's this?]

Close window