![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jul 2001
Location: U.S.of A.
Posts: 920
|
Single Page password protection question
Hahahaha - that Subject rhymed
![]() Anyway, I have no idea about password protection but I was wondering if there was a very simple way to protect just one page on a server. It doesn't even need to be a good one. It's really just for show. Any help would be appreciated. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Ask me about negative cash flow
Join Date: Feb 2001
Posts: 533
|
toooo many ways to do it:
here is one of them, just put this code into the page you want to protect: Code:
<? If (!IsSet($PHP_AUTH_USER)) { Header("HTTP/1.0 401 Unauthorized"); Header("WWW-Authenticate: Basic realm=\"Whatever you want to write here\""); echo "You must provide login/password to access this page."; exit; } else { if (($PHP_AUTH_PW != "your_passwd") || ($PHP_AUTH_USER != "your_username")) { Header("HTTP/1.0 401 Unauthorized"); exit; } } ?> This code works only with one username and password. If you want multiple accounts to access this page it's a bit complicated but not impossible ![]() If you want code for more users, just LMK. I'll post it here. Hope that helps ------------------ Smashing Thumbs TGP |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Ask me about negative cash flow
Join Date: Feb 2001
Posts: 533
|
there should be "<?" before
Code:
If (!IsSet($PHP_AUTH_USER)) ![]() ------------------ Smashing Thumbs TGP [This message has been edited by Robert (edited 09-09-2001).] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Ask me about negative cash flow
Join Date: Feb 2001
Posts: 533
|
.
[This message has been edited by Robert (edited 09-09-2001).] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jun 2001
Location: Houston, Texas
Posts: 329
|
If you don't have php, you could put the page in its own directory with a file called .htaccess. It's pretty simple but if you can't get it I'm sure the pros at http://memberscripts.com could help you out.
Kisses, Jade |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
ol' timer
Industry Role:
Join Date: Jan 2001
Location: Seattle WA
Posts: 4,715
|
hey robert... maybe you could help me withthis... (technically.. I'm a moron...so even after you give me the answer... I'll probably ask more questions.) I run a membership site. The problem. we recently got listed on a couple of password sites. we put in a 401 redirection script on anybody that doesn't enter a username and password to get access to the members area. We used to direct them all to the join. But after the people got ahold of the password. We started dumping them all to a program that we made more money off of. what i'm wondering is if there is a way with mod perl ... to redirect based on the referring url.... then dump all the people coming from offsite locations (password sites) to the sponsor page. And dump all the people from internal pages to our join page. |
![]() |
![]() ![]() ![]() ![]() ![]() |