How do I make a page password protected?
For the life of me I can't seem to figure this out.
GD13,
How do I make a page password protected?
For the life of me I can't seem to figure this out.
GD13,
VodaHost
Your Website People!
1-302-283-3777 North America / International
07031847328 / United Kingdom
------------------------
Top 3 Best Sellers
Web Hosting - Unlimited disk space & bandwidth.
Reseller Hosting - Start your own web hosting business.
Search Engine & Directory Submission - 300 directories + (Google,Yahoo,Bing)
Try this script User name = mike ,password=4444 ---The page must be named with .php extension to workOriginally Posted by GoldDraco13
Remove // from each line but leave the lines marked ////
//<?PHP
//if(!isset($PHP_AUTH_USER))
//{
//Header("WWW-Authenticate: Basic realm=\"Members Only\"");
//Header("HTTP/1.0 401 Unauthorized");
//echo "<h1>Authorization Required.</h1>This server could not verify that you are authorized to access the document requested. Either you //supplied the wrong credentials (e.g., bad password), or your browser doesn t understand how to supply the credentials required.\n";
//exit;
//}
//else
//{
//$user_pass = array (
////add an unlimited username and password below
////EX: "new_user" => "new_pass", "joe" => "333",
//"mike" => "4444",
//"aaa@aaa.com" => "pass"/*this must be the last one*/
//);
//if (($PHP_AUTH_USER == "") || ($PHP_AUTH_PW == ""))
//{
//header('WWW-Authenticate: Basic realm="Members Only"');
//Header("HTTP/1.0 401 Unauthorized");
//echo "<h1>Authorization Required.</h1>This server could not verify that you are authorized to access the document requested. Either you //supplied the wrong credentials (e.g., bad password), or your browser doesn t understand how to supply the credentials required.";
//exit;
//}
//else if (strcmp($user_pass[$PHP_AUTH_USER],$PHP_AUTH_PW) == 0)
//{
//echo "Logged in";
//?>
////Now the page to protected
////<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
//<html>
//<head>
//<title>Untitled</title>
//</head>
//<body>
//Hello
//</body>
//</html>
////End the page to protected
////Put this code at the end of the page
//<?
//exit;
//}
//else
//{
//header('WWW-Authenticate: Basic realm="Members Only"');
//Header("HTTP/1.0 401 Unauthorized");
//echo "<h1>Authorization Required.</h1>This server could not verify that you are authorized to access the document requested. Either you //supplied the wrong credentials (e.g., bad password), or your browser doesn t understand how to supply the credentials required."; exit;
//}
//}
//?>
Thanks, ***** that link just goes to main page, still don't see where the tutorial is but thats ok cause I figured it out, and alot easyier then adding a script.
Heres what you do for those that run into this problem as well.
Goto your control panel and into your file manager, add a folder to your public_html and name it whatever(for this example we'll name it admin)
Now that we have the new folder in the public_html folder named admin, exit file manager and go into password protect directories and locate the new admin folder on the menu given, which should be in public_html by default.
Select the folder and edit the properties and add the info for username and password.
Once this is done you can start making pages like normal and upload them to this new folder by changing the path to public_html/admin when publishing your page. Make sure to change this back when publishing other pages not meant for that directory. The publishing menu box remembers what was last enetered.
Thanks again for your help, and I hope this clears it up for anyone else that runs into this problem.
GD13,
Thanx GD13! That was real helpful! ^_^Originally Posted by GoldDraco13
I've successfully created and published a password protected page (called www.aalrrhome.com/membersonly_home). However, when I tried to login from my index site (www.aalrrhome.com) and got directed to the www.aalrrhome.com/membersonly_home page, I get that message "the page cannot be found", despite the fact that I was able to publish the page. Does anyone know what could be the problem?
Hi there,Originally Posted by GoldDraco13
Great instructions! I printed them and about to try but of course my mind is jumping to next question (probably answered very easily).
After I do this, when I create my page does it have to contain a login form on that page? Also does everyone have the same password to that page? (Does the page only have one password)
If I want to have a monthly fee for access to that page how would I prevent non payers from accessing it?
I have seen the scripts but I am like whoa nellie, blow my mind.....I am such a simpleton.... lol
sparrow
way to cool! Just watched tutorial. Answered questions. I'm dancin! I'm dancin! lalalalalalala
www.aalrrhome.com/membersonly/_home
Instead of naming this page "_home" you can name it "index"
Then the link would be:
www.aalrrhome.com/membersonly
There are currently 1 users browsing this thread. (0 members and 1 guests)