How do I make a page password protected?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • GoldDraco13
    Sergeant Major

    • Jun 2005
    • 92

    How do I make a page password protected?

    How do I make a page password protected?

    For the life of me I can't seem to figure this out.


    GD13,
  • VodaHost
    General & Forum Administrator

    • Mar 2005
    • 12356

    #2
    Web hosting tutorial about how to create and publish an amazing an website using our various tools. From VodaHost web hosting.

    VodaHost

    Your Website People!
    1-302-283-3777 North America / International
    02036089024 / United Kingdom
    291916438 / Australia

    ------------------------

    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)


    Comment

    • christobal
      First Sergeant

      • Jun 2005
      • 73

      #3
      password protect single page

      Originally posted by GoldDraco13
      How do I make a page password protected?

      For the life of me I can't seem to figure this out.


      GD13,
      Try this script User name = mike ,password=4444 ---The page must be named with .php extension to work
      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;
      //}
      //}
      //?>
      To steal ideas from one person is plagiarism; to steal from many is research!

      Comment

      • GoldDraco13
        Sergeant Major

        • Jun 2005
        • 92

        #4
        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,

        Comment

        • reichiliu
          Corporal

          • Sep 2005
          • 11

          #5
          Originally posted by GoldDraco13
          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! ^_^

          Comment

          • reichiliu
            Corporal

            • Sep 2005
            • 11

            #6
            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?

            Comment

            • sparrow
              Master Sergeant

              • Oct 2005
              • 65

              #7
              And the next step is? I am in suspense... lol

              Originally posted by GoldDraco13
              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,
              Hi there,
              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
              Digital Visual Memories
              Lasting Presentations
              MomsWeek

              Comment

              • sparrow
                Master Sergeant

                • Oct 2005
                • 65

                #8
                way to cool! Just watched tutorial. Answered questions. I'm dancin! I'm dancin! lalalalalalala
                Digital Visual Memories
                Lasting Presentations
                MomsWeek

                Comment

                • bängel
                  Corporal

                  • Nov 2007
                  • 10

                  #9
                  Re: How do I make a page password protected?

                  Originally posted by reichiliu View Post
                  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?
                  I have the exact same problem. I guess I should link in another way, but how?

                  Comment

                  • CarbonTerry
                    Major General

                    • Oct 2005
                    • 2620

                    #10
                    Re: How do I make a page password protected?

                    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
                    CarbonTerry
                    Semper Fi
                    Still green...still mean......just not as lean

                    Red Hawk Archery
                    Zone 5 Photo
                    My USMC

                    Comment

                    Working...
                    X