Click to See Complete Forum and Search --> : sending Message to another ASP. possible?
Cerebrate
Jun 20th, 2000, 05:11 AM
is it possible to send a string to another user who is viewing my web page?
or just to check if they are on line or something.
Cerebrate
asabi
Jun 20th, 2000, 02:05 PM
Well,
I am not sure what you mean by that..
but what you can do (in case you know their IP address before hand) is that the page would send you an Email when ever they come in.
I think that the most you can get, but again, you have to know their IP address, this mean that they should have a static IP which not too many people have ..
If you want any more information about that, just ask.
:-)
Cerebrate
Jun 20th, 2000, 08:33 PM
Thanks.
I want to create a chatroom-like page. but user doesn't have to logon to show their ID, I will get their IP and determain myself.
I will create a textbox to let user send message to all other user who's viewing the page. the message only shows in part of the page (it's not just a chatroom).
any suggestions about how to do that??
do I need to keep refreshing my page?
Cerebrate
I'm not up on ASP, but when the client (webbrowser) requests a URL off the server (webserver), the client has to tell the server what its IP is. Surely ASP has some environment variables that are defined during this request/transaction. So I would say you can do it. BUT if you don't reply with your string during the current request, potentially the IP can be different/invalid for your needs.
Zandura
Jun 22nd, 2000, 03:23 AM
I don't think you would be able to do this because of changing IP addresses. If your friend logged in today, with IP address... 123.43.211.32 and tomarrow he logged on as 123.43.201.43. you would not be able to recognize him. Now if you were going by session and not just because they are your buddies, then it may be possible, and yes, you would have to continually refresh the page so that anything sent would then be shown on your page, that is inevitible.
The best way to do something like this is to have a database that holds the quote and when they resubmit, you can then have the database be read and display that message to the screen.
Zandura
[Edited by Zandura on 06-22-2000 at 04:27 PM]
Cerebrate
Jun 22nd, 2000, 04:30 AM
thanks all.
well, I know how to get their IP now, I know most of them are dynamic, but I will try to tell who they are(maybe by cookies).
anyway I need to keep refreshing my page.
so.
How can I keep refreshing my page?
BTY, how do you post your code with that kind of effect in this board?
thanks again
Cerebrate
Mark Sreeves
Jun 22nd, 2000, 03:14 PM
I amaze myself sometimes! :eek:
This will refresh the page every 5 seconds.
put this in a file called 'refr.asp'
<%@ Language=VBScript %>
<HTML>
<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
setTimeout('refresh()',5000);
}
function refresh() {
window.location.href = 'refr.asp';
}
startTimer();
//--></SCRIPT>
</HEAD>
<body onload="startTimer()">
<%
Response.Write now()
%>
</BODY>
</HTML>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.