Unstoppable Domains โ€” Expired Auctions

Need some help with coding sumtin

SpaceshipSpaceship
Watch

commes

Established Member
Impact
11
ok, i'm going to be starting a site soon, but i only want it so that a few ip's will be able to see it, as they are going to be beta testers, so is there a code so that when an ip is not on the list it will go to another page?i need this soon so if you know the code, please post it.thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
u cud use PHP to get the user's IP address, by having this:

PHP:
$ip = getenv(REMOTE_ADDR);
and then use
PHP:
$website="HTML CODE OF BETATESTING WEBSITE";
$website2="HTML OF EVERYONE ELSE";
if($ip==IPADDRESS1){
echo($website); 
}
else if($ip==IPADDRESS2){
echo($website);
}
else{
echo($website2);
}

it gets repititious for many users and it may look ugly, but it should work.
 
1
•••
ok, thanks for the code, will add to your rep
 
0
•••
PHP:
<?php

$ip = $_SERVER['REMOTE_ADDR'];

$allowed = array("ip1", "ip2","ip3"); //etc

if(in_array($ip, $allowed))
{
  //Page for beta testers
}
else
{
  //Regular site
}
?>
 
0
•••
Does this need to be in PHP or can you work with ASP?
 
0
•••
SecondVersion said:
PHP:
<?php

$ip = $_SERVER['REMOTE_ADDR'];

$allowed = array("ip1", "ip2","ip3"); //etc

if(in_array($ip, $allowed))
{
  //Page for beta testers
}
else
{
  //Regular site
}
?>
where in this code would i put the ip's that i want to allow?
 
0
•••
commes said:
where in this code would i put the ip's that i want to allow?
In this line:
PHP:
$allowed = array("ip1", "ip2","ip3"); //etc

And replace ip1, ip2, ip3 with IP's you want to allow. More can be added, just seperate with a ,

-Eric
 
0
•••
oh ok, thanks, ill need this code as soon as i buy the domain for it.
 
0
•••
@brewmonkey

this code is written for PHP, but I am sure with a few syntax/function changes the same thing can be accomplished in ASP. I'm not sure about what it would be tho, since I have no knowledge of ASP
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back