Password Protected Webpages..

shohil

New Member
Messages
11
Reaction score
0
Points
1
Can anyone provide me the script. I want to protect my pages through password. I want only my members to view that specified pages.

Thanks
 
Last edited:

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
you might want to try a CMS, rather than coding it yourself, since there might be security flaws, and what not
I suggest Joomla, but there are others
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
There are a couple of ways to do it.

1. Use .htacess. This provides a very secure way of protecting pages/folders, but it doesn't look very nice. (Deadlock is a good .htaccess password manager.)
2. Use PHP. this method allows you to customise the look of the login box etc. but usually takes longer to set-up as you need to add some code to the top of every page you want protecting. (I use vAuthenticate for my website. But there are many more).

If you need help setting up any of these please ask.
 
Last edited:

shohil

New Member
Messages
11
Reaction score
0
Points
1
@ TechAsh

Can you explain me in detail. I dont have any much knowledge about it.

If you will provide me the link, I will read.

Thanks
 
Last edited:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
You can read about .htaccess password protection here http://www.javascriptkit.com/howto/htaccess3.shtml

If you are trying to protect a members area (Somewhere where visitors can login), then I would recommend using PHP login. (It looks nicer, and is easier to integrate and administer.) There are hundreds of different scripts to protect your pages (Then one I linked to in my other post is the one I use. It's quite simple, but it works and is highly customisable.)

If you need more instructions on exactly how to integrate a login system, either read the instructions that come with the program, or ask and I'll see what I can do.
 

shohil

New Member
Messages
11
Reaction score
0
Points
1
Ok thank you.

I dont have knowledge about php programming. You tell me the best and the easiest way to make members area. Also tell me the procedure for that.

Thanks
 
Last edited:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
First download vSignup. Then upload the files to the folder you want to protect.

Then open phpMyAdmin and run the 'createdb.sql' file to create the needed tables.

Next you need to add this code to the pages you want to protect (The pages must be php files):
<?php
require_once ("auth.php");
require_once ("authconfig.php");
require_once ("check.php");
?>
Note you may need to change the path to the 3 files.

Next login to the Admin panel (username=admin, password=access) and check/change any settings.

Done. (You should read the documentary included in the download, because it explain the setup in more detail.)

The instructions in the Documentary are:
Installation:

1. Launch your database manager (phpMyAdmin) for MySQL and run the createdb.sql file.

2. Modify authconfig.php to match your database settings and your file pathing.

3. Modify auth.php to match your database settings.

4. Modify signup config to match your database settings, file pathing, and administrator email address.

5. You can modify the login.php page to suit your needs or better yet, use your own page and include a login box. One of the rules is that you SHOULD include the authconfig.php in whichever page you will have your login box at (let's say, your index.php). Also, take note of these requirements for the login box:
a. The page where the login box is located should be a PHP file, not an HTML file.
b. Login box's form action parameter should be set to <?php echo $resultpage; ?> as it gets the value from the authconfig.php that we included.
c. The username field should have a name of 'username' without the quotes.
d. The password field should have a name of 'password' without the quotes.

6. All files under the admin folder must remain that way. The admin folder itself MUST reside inside the folder where vSignup is located. Although you can change this in authconfig.php, it is not recommended to change the line unless you know a great deal about server-side includes and pathname resolution.

7. The members directory can be anywhere as vSignup allows you to protect files outside the vSignup folder as long as the protected file is a PHP file and it has proper pathing for the 3 include files (auth.php, authconfig.php, andcheck.php).

8. Upload all files to your server using ASCII. You can disregard createdb.sql (we have already used it in step 1), README.txt, documentation.html, AuthClass.txt, and faq.txt as these are not used in the script itself.

This is a simple tutorial that should get you going, you will probable want to edit the script to make i match the style of your website. Unfortunately it doesn't use template, but you only need to know HTML to edit it.
 
Last edited:

technocrat

New Member
Messages
13
Reaction score
0
Points
0
:) NIce one TechAsh . Appreciated for the previous page.

But , for a newbie , i would go with your first idea - the CMS thing.

Joomla is better , cos you have many templates around the space to pick one and get started.

@sohail .
the best and easiest way is go instal joomla into your site . The easiest way ? go into the Cpanel of your hosting account and install joomla from FANTASTICO . just a few steps and you can see your own CMS runnin .

peace
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
phpMyAdmin is the database administration tool in the cPanel.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
To customise it you need to edit the CSS for the Template that you are using. This can be done form the Admin Panel. You need to edit the file called 'template.css' and find this section:
a#sitename1{
display:block;
width:290px; /* maximum 500px */
height:52px; /* maximum 68px */
text-indent:-2000px;
background:url(Change This to the url of your logo) top left no-repeat;
}
 
Top