August 1999
Intermediate to advanced
1488 pages
72h 53m
English
request.ip
The ip property of the request object specifies the IP address of the requesting client.
Listing 8.108 checks the IP address of the requesting client. If the IP address is not within the correct domain, the browser is redirected to an "unauthorized IP" page.
<SERVER>
// See if the IP address is ok
if(request.ip.indexOf("207.200.75.") != -1){
// Send them to an authorized page
redirect(addClient("/authorized.html"));
}else{
// Send them to an error page
redirect(addClient("/unauthorized.html"));
}
</SERVER>
|
Read now
Unlock full access