NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page need some help with coding sumtin

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-01-2005, 03:13 PM THREAD STARTER               #1 (permalink)
Senior Member
 
commes's Avatar
Join Date: May 2005
Location: Regina, Sask, Canada
Posts: 1,318
commes is just really nicecommes is just really nicecommes is just really nicecommes is just really nice
 



need some help with coding sumtin


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!
commes is offline  
Old 11-01-2005, 04:41 PM   #2 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



u cud use PHP to get the user's IP address, by having this:

PHP Code:
$ip getenv(REMOTE_ADDR); 
and then use
PHP Code:
$website="HTML CODE OF BETATESTING WEBSITE";
$website2="HTML OF EVERYONE ELSE";
if(
$ip==IPADDRESS1){
echo(
$website); 
}
else if(
$ip==IPADDRESS2){
????: NamePros.com http://www.namepros.com/programming/136782-need-some-help-with-coding-sumtin.html
echo(
$website);
}
else{
echo(
$website2);

it gets repititious for many users and it may look ugly, but it should work.
nasaboy007 is offline  
Old 11-01-2005, 05:11 PM THREAD STARTER               #3 (permalink)
Senior Member
 
commes's Avatar
Join Date: May 2005
Location: Regina, Sask, Canada
Posts: 1,318
commes is just really nicecommes is just really nicecommes is just really nicecommes is just really nice
 



ok, thanks for the code, will add to your rep
commes is offline  
Old 11-01-2005, 05:45 PM   #4 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
PHP Code:
<?php

$ip 
$_SERVER['REMOTE_ADDR'];

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

if(in_array($ip$allowed))
{
  
//Page for beta testers
}
else
{
  
//Regular site
????: NamePros.com http://www.namepros.com/showthread.php?t=136782
}
?>
Eric is offline  
Old 11-01-2005, 06:16 PM   #5 (permalink)
NamePros Regular
 
brewmonkey's Avatar
Join Date: Oct 2005
Posts: 240
brewmonkey is a jewel in the roughbrewmonkey is a jewel in the roughbrewmonkey is a jewel in the rough
 



Does this need to be in PHP or can you work with ASP?
brewmonkey is offline  
Old 11-01-2005, 07:42 PM THREAD STARTER               #6 (permalink)
Senior Member
 
commes's Avatar
Join Date: May 2005
Location: Regina, Sask, Canada
Posts: 1,318
commes is just really nicecommes is just really nicecommes is just really nicecommes is just really nice
 



Originally Posted by SecondVersion
PHP Code:
<?php

$ip 
$_SERVER['REMOTE_ADDR'];

$allowed = array("ip1""ip2","ip3"); //etc
????: NamePros.com http://www.namepros.com/showthread.php?t=136782

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?
commes is offline  
Old 11-01-2005, 08:09 PM   #7 (permalink)
Senior Member
 
Eric's Avatar
Join Date: Mar 2005
Posts: 4,948
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Originally Posted by commes
where in this code would i put the ip's that i want to allow?
In this line:
????: NamePros.com http://www.namepros.com/showthread.php?t=136782
PHP Code:
$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
Eric is offline  
Old 11-01-2005, 08:43 PM THREAD STARTER               #8 (permalink)
Senior Member
 
commes's Avatar
Join Date: May 2005
Location: Regina, Sask, Canada
Posts: 1,318
commes is just really nicecommes is just really nicecommes is just really nicecommes is just really nice
 



oh ok, thanks, ill need this code as soon as i buy the domain for it.
commes is offline  
Old 11-02-2005, 03:23 PM   #9 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



@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
nasaboy007 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cheap PSD Slicing and Coding Services GHOwner Web Development Wanted 1 10-04-2005 05:30 PM
Concepts and coding. Miss Wiggle Web Design Reviews 4 09-28-2005 01:15 PM
Small Coding Jobs Fewski Web Development Wanted 4 05-04-2005 06:23 PM
Need Coding Done... resolva Web Development Wanted 3 04-03-2005 11:02 AM
Help with coding a Links Page in PHP/MySQL matt001 Programming 3 04-13-2004 01:57 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:25 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger