GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Single Page password protection question (https://gfy.com/showthread.php?t=38353)

The Truth 09-09-2001 05:28 AM

Single Page password protection question
 
Hahahaha - that Subject rhymed http://bbs.gofuckyourself.com/board/smile.gif

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.

Robert 09-09-2001 06:07 AM

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 http://bbs.gofuckyourself.com/board/smile.gif
If you want code for more users, just LMK. I'll post it here.
Hope that helps

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

Robert 09-09-2001 06:10 AM

there should be "&lt;?" before
Code:

If (!IsSet($PHP_AUTH_USER))
I have it in my post, but it's not shown. Dunno why http://bbs.gofuckyourself.com/board/confused.gif

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

[This message has been edited by Robert (edited 09-09-2001).]

Robert 09-09-2001 06:13 AM

.



[This message has been edited by Robert (edited 09-09-2001).]

Jade 09-09-2001 11:13 AM

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

BrettJ 09-09-2001 01:26 PM


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.



All times are GMT -7. The time now is 01:36 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123