Click to See Complete Forum and Search --> : Site / IP Alert
DjAzy
May 28th, 2005, 03:26 PM
Hey guyz, unfortuantly i am not much of a coder.
I think it would need to be written in javascript but im not entirly sure.
I need a system to place on my linux server that can alert everybody who is on my website and if possiable a way to alert an IP address.
Could somebody please point me in the right direction.
I know its a bit to ask but i really need this tool for my site, i heave searched google high and lost and just cant find what i need.
I dont believe it can be that complicated script and somebody must know where I can get a tool like this.
Thx Alot
Az
Dr. Script
June 1st, 2005, 07:41 PM
3 Things:
1) Not sure what you are asking
2) Don't think it is possible.
3) Security issues may intervene ...
DjAzy
June 13th, 2005, 11:42 AM
It is possiable cuz other sites have done it and they don't seem to have security issues with it.
Dr. Script
June 13th, 2005, 12:47 PM
It is possiable cuz other sites have done it and they don't seem to have security issues with it.It is not possible with JavaScript. Other languages make it possible, such as PHP or ASP. However, if you need help with PHP, I'll move this thread to that forum. Would you like that?
PeejAvery
June 13th, 2005, 02:18 PM
Use PHP to do so. But if the computer goes through a proxy, you have to set the IP address of the server to be ignored by the proxy manager.
<?php echo $_SERVER['REMOTE_ADDR']; ?>
You may also insert this in this manner into HTML...
<input type="text" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
DjAzy
June 18th, 2005, 07:13 PM
Use PHP to do so. But if the computer goes through a proxy, you have to set the IP address of the server to be ignored by the proxy manager.
<?php echo $_SERVER['REMOTE_ADDR']; ?>
You may also insert this in this manner into HTML...
<input type="text" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
yes please do move this to php.
now thanks alot for that. Please tell me if this would work.
a form like
<form action="alert.php" method="post">
Ip to alert: <input type="text" name="ip">
Alert mesage:<input type="text" name="alert">
<input type="submit" value="submit">
</form>
then alert.php
if $_SERVER['REMOTE ADDR'] == "$ip"{;
<script alert ('$alert');
};
PeejAvery
June 18th, 2005, 11:02 PM
HTML file.
<html>
<title>IP Page</title>
<body>
<form action="alert.php" method="post">
Ip to alert: <input type="text" name="ip">
Alert mesage:<input type="text" name="alert">
<input type="submit" value="submit">
</form>
</body>
</html>
alert.php
<html>
<title>IP AUTHORIZATION</title>
<body>
<?php
$ip = $_POST['ip'];
$alert = $_POST['alert'];
if($ip==$_SERVER['REMOTE_ADDR']){
echo "<script language='javascript'>window.alert('$alert');</script>";
}
?>
</body>
</html>
DjAzy
June 19th, 2005, 04:52 AM
Wait, that will only work if the person with that IP clicks submit wont it? - is it possiable to force a refresh on a page when you click submit? so when you alert the ip everybody on the site if forced to that alert.php file which shold alert the person who's ip address is entered
PeejAvery
June 22nd, 2005, 04:21 PM
No. What the script that I just wrote you does is allows you to write an IP and an alert. If the IP matches the IP for the machine that is viewing your webpage, then it will display the alert that was typed. From there you may adapt the script to your liking.
Basically you now have the PHP way of getting the viewer's IP address. Note: this will not work if the computer is routing through a proxy server unless the proxy forwards the address.
DjAzy
June 24th, 2005, 04:52 AM
I have tested it and it only works if a user type's their IP address and message in then clicks submit, it does not send the alert to any other user
Dr. Script
June 24th, 2005, 08:45 AM
I have tested it and it only works if a user type's their IP address and message in then clicks submit, it does not send the alert to any other userIf I've followed correctly, that seems to be the intention ...
PeejAvery
June 24th, 2005, 01:06 PM
I have tested it and it only works if a user type's their IP address and message in then clicks submit, it does not send the alert to any other user
As I have said, this is just an example of how to get you started. The following code will return the user's IP address. It is up to you to do with it from there.
After reading your first post again, I think this might be what you want.
<html>
<body>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
echo "<script type='text/javascript'>";
echo "window.alert('Your IP Address Is: $ip')";
echo "</script>";
?>
<!--Your HTML Here-->
</body>
</html>
DjAzy
July 14th, 2005, 03:58 PM
Not at all! I want to be able to laucn an alert on remote browsers via their IP. The user has nothing to do with the calling of it
PeejAvery
July 16th, 2005, 12:10 PM
I am now really confused. So you want the server to recognize the IP of the person viewing a page and then the server sends an alert? To whom?
DaveGerard
July 18th, 2005, 05:29 PM
You're still going to have to capture that IP somehow. Here is the VbScript code.
MyIp = Request.ServerVariables("REMOTE_ADDR")
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.