# Display IP address on secure site

**URL:** <https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693>\
**Category:** RapidWeaver Classic\
**Created:** [March 10, 2019, 6:17pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693 "2019-03-10T18:17:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![peglomaniac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/peglomaniac/32/11510_2.png) [@peglomaniac](https://forums.realmacsoftware.com/u/peglomaniac)\
**Post date:** [March 10, 2019, 6:17pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/1 "2019-03-10T18:17:54Z")

</div>

Hi,

I have assigned SSL to a website that has a need to display the users’ IP address, but now the IP address is not displaying.

The site is [https://eliminators.ca/verify\_addy.php](https://eliminators.ca/verify_addy.php) and the IP address should appear just below “This is your IP address”.

Can anyone tell me a way so this can still function?

TIA

---

<div class="post-metadata">

**Author:** ![willwood](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@willwood](https://forums.realmacsoftware.com/u/willwood)\
**Post date:** [March 10, 2019, 7:22pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/2 "2019-03-10T19:22:30Z")

</div>

Your current webpage has lots of errors about mixed content from non-SSL sources, which is probably why portions of it are failing to work.

My solution derived from [this](https://stackoverflow.com/a/41711786) StackOverflow comment:

```
<div id="ip_result">Fetching IP address...</div>

<script>
	const resultDiv = document.getElementById("ip_result");
	function getIPAddress(json) {
	     resultDiv.innerHTML="My IP Address is: " + (json.ip);
	}
</script>

<script src="https://ipinfo.io/?format=jsonp&callback=getIPAddress"></script>

```

Tested and working in RapidWeaver 8 and over SSL. It is pure HTML + JavaScript. Place it wherever you want the IP address shown in the page.

‘ip\_result’ is the container for displaying the IP address. We put some simple content (_Fetching IP address…_) in here while the page is loading.

The JavaScript uses the document object to get the container as a variable. Then we define a new function called _getIPAddress_ and pass our JSON callback from [https://ipinfo.io](https://ipinfo.io) as an argument. Output a simple text string and the returned IP address within the function.

The text ‘My IP Address is:’ can be changed deleted if it is not required.

Emphasis on the fact that this is a very simple solution. Won’t work if JavaScript is disabled or perhaps if certain privacy blocks are in place. Can’t say for sure what will happen if a proxy is being used. But if you want simple, this should work as a copy and paste solution.

---

<div class="post-metadata">

**Author:** ![teefers](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/teefers/32/8173_2.png) [@teefers](https://forums.realmacsoftware.com/u/teefers)\
**Post date:** [March 10, 2019, 7:22pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/3 "2019-03-10T19:22:50Z")

</div>

You have a lot of mixed content on the page listed above:

 ![2019-03-10_12-12-37](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/6/66d3278e283791a8bffb6c16663201162c54a999.jpeg)

Not sure how you are getting the IP address, but I bet it’s being blocked because of the mixed (unsecure) content.

---

<div class="post-metadata">

**Author:** ![martys](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@martys](https://forums.realmacsoftware.com/u/martys)\
**Post date:** [March 11, 2019, 8:06pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/4 "2019-03-11T20:06:58Z")

</div>

Very Helpful. I like helpful people who answer, is keeps us mortals from having to ask 1000’s of questions and making 1000’s of mistakes.

Super Thanks

---

<div class="post-metadata">

**Author:** ![peglomaniac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/peglomaniac/32/11510_2.png) [@peglomaniac](https://forums.realmacsoftware.com/u/peglomaniac)\
**Post date:** [March 11, 2019, 8:36pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/5 "2019-03-11T20:36:08Z")

</div>

Many thanks @willwood. That works perfectly. I appreciate this.

---

<div class="post-metadata">

**Author:** ![peglomaniac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/peglomaniac/32/11510_2.png) [@peglomaniac](https://forums.realmacsoftware.com/u/peglomaniac)\
**Post date:** [March 11, 2019, 8:38pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/6 "2019-03-11T20:38:53Z")

</div>

Hi @teefers - I am not sure where that content comes from, I just used a bit of code I found online. I also just in the past couple of days added SSL to my sites, so I am finding a lot of instances of http instead of https, so I am working through that too. Thanks for the reply. 🙂

---

<div class="post-metadata">

**Author:** ![martys](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@martys](https://forums.realmacsoftware.com/u/martys)\
**Post date:** [March 11, 2019, 8:57pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/7 "2019-03-11T20:57:19Z")

</div>

Peg I also had my host redirect my sites to https today.  
Then I went through every project in RW and switched the several site addresses, General and publish settings. Then I cleared the caches in safari and firefox, then I went through my safari history and cleared out all those http history items from my sites in the history.

Next try Develop\>show source\>console\>warnings

see Teefers post above

---

<div class="post-metadata">

**Author:** ![willwood](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@willwood](https://forums.realmacsoftware.com/u/willwood)\
**Post date:** [March 11, 2019, 9:25pm UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/8 "2019-03-11T21:25:17Z")

</div>

Others on this forum have found the following website useful in trying to determine why a secure website is still pulling-in things from insecure sources or displaying other related errors:

[https://www.whynopadlock.com/](https://www.whynopadlock.com/)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [April 11, 2019, 7:25am UTC](https://forums.realmacsoftware.com/t/display-ip-address-on-secure-site/25693/9 "2019-04-11T07:25:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
