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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-09-2001, 05:28 AM   #1
The Truth
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.
The Truth is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-09-2001, 06:07 AM   #2
Robert
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") &#0124;&#0124; ($PHP_AUTH_USER != "your_username"))
  {
        Header("HTTP/1.0 401 Unauthorized");
        exit;
  }
}  
?>
dont forget to make sure you can run PHP on your server and rename that file to something with .php .php3 .phtml extension (depends on config of your web server)
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
Robert is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-09-2001, 06:10 AM   #3
Robert
Ask me about negative cash flow
 
Join Date: Feb 2001
Posts: 533
there should be "&lt;?" before
Code:
If (!IsSet($PHP_AUTH_USER))
I have it in my post, but it's not shown. Dunno why

------------------
Smashing Thumbs TGP

[This message has been edited by Robert (edited 09-09-2001).]
Robert is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-09-2001, 06:13 AM   #4
Robert
Ask me about negative cash flow
 
Join Date: Feb 2001
Posts: 533
.



[This message has been edited by Robert (edited 09-09-2001).]
Robert is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-09-2001, 11:13 AM   #5
Jade
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
Jade is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-09-2001, 01:26 PM   #6
BrettJ
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.

BrettJ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.