Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   A Couple Small Scripts (http://www.programmingforums.org/showthread.php?t=9393)

toole Apr 16th, 2006 3:39 PM

A Couple Small Scripts
 
So I believe the easiest way to do these would be with js, but I am not proficient with it.

I am wanting to make an ip display for users to see on my site, but I'd like it in this format "Welcome 'ip address'" I don't want a box around it, I would like it best to be placed in the normal body text.

Along with that I am trying to find a site counter, that doesn't offer a ton of stats. I just want a simple counter - simple gui - very simple. Just to count the visits to the site by unique IP's.

If anyone can help it'd be really appreciated. :banana:

-toole

Prm753 Apr 16th, 2006 6:05 PM

I can't really help you with your first question, but as for your second: http://www.statcounter.com/ << everything you need, right there.

demon101 May 13th, 2006 10:45 PM

are you talking about something like what is on this site www.admins101.com

how it has got the box that shows your ip address?

Booooze May 13th, 2006 11:01 PM

Quote:

Originally Posted by demon101
are you talking about something like what is on this site www.admins101.com

how it has got the box that shows your ip address?

That site looks cool :p Off topic but ok :p

As for showing the IP, its easy with php (google)

but if you want it in javascipt, look here:

http://javascript.internet.com/user-...p-address.html

just edit that code to display the ip where you want it on the site. simple.

demon101 May 13th, 2006 11:11 PM

if you look on the left side of that page it has a box that shows your i[p address that you are on. that is what i was showing him.

Infinite Recursion May 14th, 2006 12:54 AM

in PHP, its very easy... not too sure about javascript.

$userip = $_SERVER['REMOTE_ADDR'];
echo "Welcome $userip"

Booooze May 14th, 2006 1:43 AM

@demon101 - yup, I saw that. I still think the page was cool :p the background is what caught my eye.

@IR - that code looks familar :) I just couldnt recall it, and was too lazy to google it.

DaWei May 14th, 2006 8:37 AM

If you want to accomplish the ip thangy in script on the client, just:
HTML content:
:

This is normal HTML text, and we just want
to say, Welcome
<script type=blah...>
document.write (ip);
</script>.

where 'ip' is a variable you have previously stuffed with the appropriate string.


All times are GMT -5. The time now is 10:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC