rbbb
asked on
alert messages similars to messenger service
I would like to emulate the windows messenger services popups. This is: A javascript alert message with user IP adress, date and hour. I think is necessary first to detect the user info
with PHP or ASP for example, and then display the alert message.
with PHP or ASP for example, and then display the alert message.
ASKER
OK, I need to display randomly this kind of javascript alert messages:
function alertPopup1() {
alert("Message from HAPPY HOLYDAYS to 80.25.84.74 - 16/10/2003 10:15:36\n\nHello!\n\nTher e is an incredible holydays offer on our page: \n\nhttp://www.happyholydays.com/\n\nEnjoy the life!");
}
I also would like to display the messages with
a random delay of 2-30 min.
Thanks a lot for your help.
function alertPopup1() {
alert("Message from HAPPY HOLYDAYS to 80.25.84.74 - 16/10/2003 10:15:36\n\nHello!\n\nTher
}
I also would like to display the messages with
a random delay of 2-30 min.
Thanks a lot for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
All right !! thank you so much. Only a question more about this script.
How can I display the user IP, date and hour in the text of these random alert messages?
Once more, thanks.
How can I display the user IP, date and hour in the text of these random alert messages?
Once more, thanks.
Ok here's how u'll do it.
-----for displaying the ip of the visitor :
<script language="javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {
document.myform.ipaddr.val ue=ip;
}
window.onload=ipval
</script>
<form method="post" action="" name="myform">
<input type="text" name="ipaddr" readonly>
</form>
in order to get this function to work your web srver must run ssi(most web servers do that by default)
---for displaying the date :
<script language="JavaScript">
HoldDate=new Date();
document.write(HoldDate.ge tDate() + "/" + (HoldDate.getMonth()+1) + "/" + HoldDate.getYear());
</script>
---for displaying the time :
<script type="text/javascript">
var d = new Date()
document.write(d.getHours( ))
document.write(":")
document.write(d.getMinute s())
document.write(":")
document.write(d.getSecond s())
</script>
I'm giving you the general code of the scripts,u r the one that should put all these together.
-----for displaying the ip of the visitor :
<script language="javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {
document.myform.ipaddr.val
}
window.onload=ipval
</script>
<form method="post" action="" name="myform">
<input type="text" name="ipaddr" readonly>
</form>
in order to get this function to work your web srver must run ssi(most web servers do that by default)
---for displaying the date :
<script language="JavaScript">
HoldDate=new Date();
document.write(HoldDate.ge
</script>
---for displaying the time :
<script type="text/javascript">
var d = new Date()
document.write(d.getHours(
document.write(":")
document.write(d.getMinute
document.write(":")
document.write(d.getSecond
</script>
I'm giving you the general code of the scripts,u r the one that should put all these together.
Tell me more of what you want to do.What you are saying is very general.You have to be more specific