Author Online Tracker?

I

Ioannis

Gentlemen,

Is there any online html code thingy that would allow me to show on my web page
if I am online? Only ME, the author of the web page.

Yes, I know these things don't work exactly and are crude. But when I am online
I usually have my webpage active most of the time. Perhaps a simple javascript
could do the job by detecting my own presence in my web page?

Any ideas?

Many thanks in advance,
 
M

+mrcakey

Ioannis said:
Gentlemen,

Is there any online html code thingy that would allow me to show on my web
page
if I am online? Only ME, the author of the web page.

Yes, I know these things don't work exactly and are crude. But when I am
online
I usually have my webpage active most of the time. Perhaps a simple
javascript
could do the job by detecting my own presence in my web page?

Any ideas?

Many thanks in advance,

You'd need something server side for that - to change a flag variable that
indicates whether you're on or offline. You'd probably want some kind of
cookie on your client machine to be able to trigger that behaviour without
you having to log in. It's relatively simple but not 101 stuff.
 
R

richard

Gentlemen,

Is there any online html code thingy that would allow me to show on my web page
if I am online? Only ME, the author of the web page.

Yes, I know these things don't work exactly and are crude. But when I am online
I usually have my webpage active most of the time. Perhaps a simple javascript
could do the job by detecting my own presence in my web page?

Any ideas?

Many thanks in advance,


I just have to know, why do you want to know if you are on the very
page you created? You can't tell that you are online?

Kind of like teaching a fish how to swim.
 
H

Harlan Messinger

Ioannis said:
Gentlemen,

Is there any online html code thingy that would allow me to show on my web page
if I am online? Only ME, the author of the web page.

Yes, I know these things don't work exactly and are crude. But when I am online
I usually have my webpage active most of the time. Perhaps a simple javascript
could do the job by detecting my own presence in my web page?

Any ideas?

This sounds like the state of the art weather tool. It's a piece of
rope. You hang it outside your window. If you see it blowing around,
then it's windy. It you touch it and it's wet, then it's raining.

Joking aside, I don't understand what you're asking. If you browse to
your web page and it comes up, then you're online. If it doesn't, then
you aren't.
 
A

Awful Dog Autry

Gentlemen,

Is there any online html code thingy that would allow me to show on
my web page if I am online? Only ME, the author of the web page.

Yes, I know these things don't work exactly and are crude. But when I
am online I usually have my webpage active most of the time. Perhaps
a simple javascript could do the job by detecting my own presence in
my web page?

Any ideas?

Many thanks in advance,

You could use the php command $_SERVER['HTTP_REFERER'] and check for
your own ip address but that's real iffy.
 
B

Beauregard T. Shagnasty

Awful said:
Ioannis said:
Is there any online html code thingy that would allow me to show on
my web page if I am online? Only ME, the author of the web page.

You could use the php command $_SERVER['HTTP_REFERER'] and check for
your own ip address but that's real iffy.

That's not a command, it's a value, and it does not contain the IP but
rather obviously the HTTP_REFERER (the page you came from).

This might: GetHostByName($_SERVER['REMOTE_ADDR'])
 
A

Awful Dog Autry

Awful said:
Ioannis said:
Is there any online html code thingy that would allow me to show on
my web page if I am online? Only ME, the author of the web page.

You could use the php command $_SERVER['HTTP_REFERER'] and check for
your own ip address but that's real iffy.

That's not a command, it's a value,

So what?
and it does not contain the IP but
rather obviously the HTTP_REFERER (the page you came from).

Look up Ip on Google. Here's my first result (data modified)

My IP address: xx.x.xxx.xxx
IP Address Location: Xxxxx in ip address flag United States
ISP of this IP: Xxxxxxxx

HTTP_REFERER *IS* the ip address.
This might: GetHostByName($_SERVER['REMOTE_ADDR'])

Here's what the php manual says

'HTTP_REFERER'
The address of the page (if any) which referred the user agent to
the current page. This is set by the user agent. Not all user
agents will set this, and some provide the ability to modify
HTTP_REFERER as a feature. In short, it cannot really be trusted.

'REMOTE_ADDR'
The IP address from which the user is viewing the current page.

so if Ioannis wants to know if he's online, REMOTE_ADDR apparently
provides his address rather than the referring-page address and your
rather inept correction, despite the fact that HTTP_REFERER *DOES*
contain an Ip (just not the right one) at least was leading in the
right direction.
 
I

Ioannis

Awful said:
Awful said:
Is there any online html code thingy that would allow me to show on
my web page if I am online? Only ME, the author of the web page.

You could use the php command $_SERVER['HTTP_REFERER'] and check for
your own ip address but that's real iffy.

That's not a command, it's a value,

So what?
and it does not contain the IP but
rather obviously the HTTP_REFERER (the page you came from).

Look up Ip on Google. Here's my first result (data modified)

My IP address: xx.x.xxx.xxx
IP Address Location: Xxxxx in ip address flag United States
ISP of this IP: Xxxxxxxx

HTTP_REFERER *IS* the ip address.
This might: GetHostByName($_SERVER['REMOTE_ADDR'])

Here's what the php manual says

'HTTP_REFERER'
The address of the page (if any) which referred the user agent to
the current page. This is set by the user agent. Not all user
agents will set this, and some provide the ability to modify
HTTP_REFERER as a feature. In short, it cannot really be trusted.

'REMOTE_ADDR'
The IP address from which the user is viewing the current page.

so if Ioannis wants to know if he's online, REMOTE_ADDR apparently
provides his address rather than the referring-page address and your
rather inept correction, despite the fact that HTTP_REFERER *DOES*
contain an Ip (just not the right one) at least was leading in the
right direction.

Many thanks, guys. Adding one bit of missing info: I need this so that OTHERS
can see if I am online, not me.

Now, _I think_ but I am not sure, that I'd also need a bit of "if" branching
with javascript.

For example,

if IP = mine, then display some hardwired html code on the page: "Author online"
else display some hardwired html code: "Author offline".

For example, the default would be: "Author offline".

As soon as I visit my own page, the hardwired html part can change to "Author
online" so that a visitor can see that, if he visits the page after my visit.

My apologies if the above is utter stupidity. I am not even sure if it will
work!

Many thanks again!
 
B

Beauregard T. Shagnasty

Awful said:
Beauregard T. Shagnasty said:
Awful said:
Is there any online html code thingy that would allow me to show on
my web page if I am online? Only ME, the author of the web page.

You could use the php command $_SERVER['HTTP_REFERER'] and check
for your own ip address but that's real iffy.

That's not a command, it's a value,

So what?

I just wanted you to know the difference between a command and a value.
Look up Ip on Google. Here's my first result (data modified)

I know what an IP is. Google returns 652,000,000 results for "IP"
HTTP_REFERER *IS* the ip address.

Not on my planet. It is the URL of the page that 'refered' you to the
page collecting the information.
This might: GetHostByName($_SERVER['REMOTE_ADDR'])

Here's what the php manual says

'HTTP_REFERER'
The address of the page (if any) which referred the user agent to
the current page. This is set by the user agent. Not all user
agents will set this, and some provide the ability to modify
HTTP_REFERER as a feature. In short, it cannot really be trusted.

Read that again carefully. "The address of the page" as in .. what is
the address of a page? It's the URL.
'REMOTE_ADDR'
The IP address from which the user is viewing the current page.

...and this is the IP address of the computer viewing the page.
so if Ioannis wants to know if he's online, REMOTE_ADDR apparently
provides his address rather than the referring-page address and your
rather inept correction, despite the fact that HTTP_REFERER *DOES*
contain an Ip (just not the right one) at least was leading in the
right direction.

I have a test page for you.
http://tekrider.net/usenet/referer.php

It will lead you to another page of mine at a different domain that
shows both your IP address and the HTTP_REFERER from the calling page,
using this:

$ip = gethostbyname($_SERVER['REMOTE_ADDR']);
$referer = $_SERVER['HTTP_REFERER'];
 
J

John Hosking

Ioannis said:
Gentlemen,

Els, Adrienne, and Heidi aren't good enough for you?
Is there any online html code thingy that would allow me to show [visitors to]
my web page if I am online? Only ME, the author of the web page.

This sounds like the functionality I see on PCs of those who use various
instant messaging products, like MSN Messenger, Yahoo! Messenger, AOL
Instant Messenger (AIM), XMPP, ICQ etc. And so, maybe these links will
lead you to an answer, one that doesn't require you to invent something
that already exists (at least partially):

http://en.wikipedia.org/wiki/Windows_Live_Messenger

http://en.wikipedia.org/wiki/Windows_Live_Messenger_IM_Control

WP says, "Windows Live Messenger IM Control is a service provided by
Microsoft as part of its Windows Live services which enables websites or
blogs to show the presence of Windows Live Messenger users..."

I have no idea if this meets your needs, how well it works, or what
security issues this raises. GL.
 
M

+mrcakey

Many thanks, guys. Adding one bit of missing info: I need this so that
OTHERS
can see if I am online, not me.

Now, _I think_ but I am not sure, that I'd also need a bit of "if"
branching
with javascript.

For example,

if IP = mine, then display some hardwired html code on the page: "Author
online"
else display some hardwired html code: "Author offline".

For example, the default would be: "Author offline".

As soon as I visit my own page, the hardwired html part can change to
"Author
online" so that a visitor can see that, if he visits the page after my
visit.

My apologies if the above is utter stupidity. I am not even sure if it
will
work!

Many thanks again!

Like I said earlier, having actually read and understood your requirement,
you need cookie processing (or a login) to detect when you're on your site
and you need something server side to respond to that cookie and display the
dynamic change to your users.
 
B

Beauregard T. Shagnasty

Ioannis said:
Many thanks, guys. Adding one bit of missing info: I need this so that
OTHERS can see if I am online, not me.

Well, that's a whole 'nother kettle of fish.

Neither my correct way, nor Awful's incorrect way will help you then.
You should have said that at the very beginning of your quest.
 
I

Ioannis

+mrcakey said:
Like I said earlier, having actually read and understood your requirement,
you need cookie processing (or a login) to detect when you're on your site
and you need something server side to respond to that cookie and display the
dynamic change to your users.

Yes, thank you, I understood that you understood, unfortunately I am fairly
clueless to all that.

If you could be more specific, I'd be glad to credit you with the solution, if
you could provide it.

Login is out, so I'd be glad to hear how cookie processing would work, if you
care to explain.
 
I

Ioannis

Beauregard said:
Well, that's a whole 'nother kettle of fish.

Neither my correct way, nor Awful's incorrect way will help you then.
You should have said that at the very beginning of your quest.

My apologies. I somehow made the stupid assumption that if I could detect
whether I am online, others would be able to.
 
M

+mrcakey

Beauregard T. Shagnasty said:
Well, that's a whole 'nother kettle of fish.

Neither my correct way, nor Awful's incorrect way will help you then.
You should have said that at the very beginning of your quest.

He did - "Is there any online html code thingy that would allow me to show
on my web page
if I am online? Only ME, the author of the web page."
 
M

+mrcakey

Ioannis said:
Yes, thank you, I understood that you understood, unfortunately I am
fairly
clueless to all that.

If you could be more specific, I'd be glad to credit you with the
solution, if
you could provide it.

Login is out, so I'd be glad to hear how cookie processing would work, if
you
care to explain.

The fundamental thing is that to change your web page you need to be able to
do some manipulation of the HTML output server side, for instance with PHP.
This would need to be triggered by an event that indicated you were online.
That event could be for instance:

- a log in,
- detecting a cookie or
- detecting your own IP address if you have a static IP (least reliable
since the HTTP header that carries this information is easily spoofed)

If you want to implement/learn some server side scripting then that is your
solution. If not, there isn't a solution I'm afraid!
 
I

Ioannis

+mrcakey wrote:
[snip]
The fundamental thing is that to change your web page you need to be able to
do some manipulation of the HTML output server side, for instance with PHP.
This would need to be triggered by an event that indicated you were online.
That event could be for instance:

- a log in,
- detecting a cookie or
- detecting your own IP address if you have a static IP (least reliable
since the HTTP header that carries this information is easily spoofed)

If you want to implement/learn some server side scripting then that is your
solution. If not, there isn't a solution I'm afraid!

I understand the principle behind the cookie method a little better, so I will
try to investigate that. I don't understand how this method could detect when I
am "leaving" my web site, though. Isn't that a bit unreliable?

Thanks again,
 
B

Beauregard T. Shagnasty

+mrcakey said:
He did - "Is there any online html code thingy that would allow me to
show on my web page if I am online? Only ME, the author of the web
page."

I interpreted it as: "[Show] Only ME, the author of the web page."
 
A

Adrienne Boswell

+mrcakey wrote:
[snip]
The fundamental thing is that to change your web page you need to be
able to do some manipulation of the HTML output server side, for
instance with PHP. This would need to be triggered by an event that
indicated you were online. That event could be for instance:

- a log in,
- detecting a cookie or
- detecting your own IP address if you have a static IP (least
reliable since the HTTP header that carries this information is
easily spoofed)

If you want to implement/learn some server side scripting then that
is your solution. If not, there isn't a solution I'm afraid!

I understand the principle behind the cookie method a little better,
so I will try to investigate that. I don't understand how this method
could detect when I am "leaving" my web site, though. Isn't that a bit
unreliable?

Thanks again,

Leaving a site is always seems to be a bit of a problem server side.
One does not know if the user timed out, closed the page, closed the
browser, etc. The only way to really know what happened is if the user
specifically logs out. One can use javascript to detect if the client
is still there, and if there is no response within a certain time,
javascipt removes the session server side.
 
A

Awful Dog Autry

I know what an IP is. Google returns 652,000,000 results for "IP"


Not on my planet. It is the URL of the page that 'refered' you to the
page collecting the information.

Ok, you're right. I was mistaking "address" for "ip address" and, of
course, they're not the same.
Read that again carefully. "The address of the page" as in .. what
is the address of a page? It's the URL.
Yep.

I have a test page for you.
http://tekrider.net/usenet/referer.php

It will lead you to another page of mine at a different domain that
shows both your IP address and the HTTP_REFERER from the calling
page, using this:

$ip = gethostbyname($_SERVER['REMOTE_ADDR']);
$referer = $_SERVER['HTTP_REFERER'];

BION, I made a page very similar to that myself once.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top