473,574 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Grab IP Address with JavaScript

Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web
page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?
Jul 19 '05 #1
12 13303
Personally, I don't know. Try asking in a client-side group such as
..scripting.jsc ript.

Ray at work

"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?

Jul 19 '05 #2
> Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.


Off topic, but yes, it's possible but you need more than Javascript. We do
it here using a Java Applet. We grab the IP with the trusted applet, then
using Javascript we write it to a cookie.
Jul 19 '05 #3
The server that's hosting the asp page can get the IP address from the
request.serverv ariables("remot e_addr"). Of course, if the client machine is
behind a firewall, the client-side resolved IP would be different. But
unless that matters, let the server do it.

Ray at work

"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?

Jul 19 '05 #4
ljb
I tried the following client side but it didn't seem 100% reliable. Seems
not everyone has Winsock installed.

strIP = CreateObject("M SWinsock.Winsoc k").LocalIP

If this thread moves to another group I don't want to lose track since I
haven't solved the problem yet.

LJB
Jul 19 '05 #5
ljb wrote:
Seems not everyone has Winsock installed.


really? must have been an oversight.

;o)

--
William Tasso - http://WilliamTasso.com
Jul 19 '05 #6
Hey guys sorry if this is off topic, I theorized that since I was sending to
ASP that it would be on target.

Again I apologize.

Larry

I will repost in the other group.

"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?

Jul 19 '05 #7
Hey guys thanks again, the consensus is that the server has to handle this
and not the client side. I had hoped to avoid this in order to cut down on
processing overhead but that's life.

Larry
"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?

Jul 19 '05 #8
Request.ServerV ariables("REMOT E_ADDR") will return the IP that the http
request comes from. This is not necessarily the primary IP of the primary
NIC in the computer with the browser. It could be a firewall, a proxy
server, a router, etc., but this may not matter.

ip.asp:

<%
Response.Write "Your IP address is " &
Request.ServerV ariables("REMOT E_ADDR")
%>
Ray at home

"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:Ot******** ******@TK2MSFTN GP10.phx.gbl...
Hey guys thanks again, the consensus is that the server has to handle this
and not the client side. I had hoped to avoid this in order to cut down on
processing overhead but that's life.

Larry
"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a

web
page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?


Jul 19 '05 #9
If you user has disabled scripting, you'll cut down on the client-side
processing too.

"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:Ot******** ******@TK2MSFTN GP10.phx.gbl...
Hey guys thanks again, the consensus is that the server has to handle this
and not the client side. I had hoped to avoid this in order to cut down on
processing overhead but that's life.

Larry
"Larry R. Baker" <lb****@eaglest rike.net> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Is it possible to grab a client side IP Address using JavaScript in an htm
page? I have a web page hosted on a non-ASP server and I want a piece of
code in JavaScript to grab the IP address of the client and send it to a web page on another server. The other page will be ASP.

I need this for both Netscape and IE browsers.

Any ideas?


Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7968
by: dan glenn | last post by:
hi. I want to code a 'preview' function into a guestbook entry page. I can do it with a button that posts, bringing up a whole new page showing a preview of what has been entered, and then the user could hit a 'return to entry form' button or some-such and go back to the form. But what I want to do instead is just use an HTML link with some...
0
2710
by: Baby Blue | last post by:
I have 2 code like below to grab a news website for my site. However, when I click some links (such as : http://wwww.vnexpress.net/xxx/xxxx ) inside the site which I want to grab, it has some errors. Can any body help me ?? Demo : news.thuthao.info The real website : vnexpress.net ...
2
3848
by: Yogev | last post by:
Hi, Looking for the solution: I want to click on my own button on ToolBar of IE6 and to activate the javascript that put the current URL (from location/address line of IE) to clipboard. My first try to do something practical with javascript, like a study case. Thanks Yogev
2
9636
by: K.H. | last post by:
Hi Does anyone know how I can grab a video stream from an IP-address? There's a video web server for live image transmission in the Internet. Data transfer is accomplished via TCP/IP. The web cam that I am using is integrated into a network with fixed IP address. The streaming software is already there, so I have to go to this IP-address to...
8
9409
by: '69 Camaro | last post by:
Perhaps I'm Googling for the wrong terms. Does anyone have links to examples of the syntax necessary to read the HTML on another Web page when that HTML is produced from JavaScript using the document.write( ) method? For a simplified example, I have two Web pages. Page 1 uses JavaScript with the following: htmlData = "<B>This is bold...
1
1375
by: LaughOutLoud | last post by:
Hi. I wonder is it possible to grab everything in a form by calling one javascript function and turns it into array or object? E.g. <form id="form1" name="form1" method="post" action=""> <input name="fname" type="text" id="fname" /> <input name="lname" type="text" id="lname" /> <input name="email" type="text" id="email" /> </form>
4
1444
by: Eric Layman | last post by:
HI, Im on dotnet 1.1 I've generated extra checkboxes, textboxes via client side javascript: eg: var inputElement = document.createElement('input'); inputElement.setAttribute('type', 'radio');...
3
4413
by: dragonfly8563 | last post by:
Hi all, I created a listbox with employees' names and email addresses in it, and a button which grabs email address once it's clicked. Currently I can only pick up one address at a time, but I also want to be able to grab multiple addresses. My code is as follows: Private Sub SendCommand_Click() Dim strName As String Dim strEmail As...
19
1862
by: JRough | last post by:
I have used this function to create a string called $headers: function GetHeaders($file_name){ return "<th><a href='".$file_name."&order_by=l_e'>L_E</a></th> <th><a href='". $file_name."&order_by=carnumber'>Carnumber</a></th> <th><a href='". $file_name."&order_by=location'>Location</a></th> <th><a href='"....
0
8042
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8226
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7806
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8094
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6442
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5297
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1053
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.