how to create a members only page

This is a discussion on "how to create a members only page" within the Web Page Design section. This forum, and the thread "how to create a members only page are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jan 10th, 2006, 19:43
Up'n'Coming Member
Join Date: Jan 2006
Location: Belfast
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
how to create a members only page

Hi,

Firstly sorry if this is in the wrong forum - was unsure which one to post it into!

Secondly, I am a newbie and learning web design as I go. I would like to create a members only section on a website, and wasn't sure how to go about it.

Can anyone suggest where I can go to either find freeware software which will assist, or an online tutorial? Or any advice to create a members only section!

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 10th, 2006, 20:04
Junior Member
Join Date: Jan 2006
Location: Leeuwarden, NL
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Re: how to create a members only page

I can't create a members-only page for you, but I can give you a UserID - Password (kind of table) code:

HTML: Select all
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page</title>
<script language="javascript">
<!--//
/*This script requires the user to give an ID and password before entering the site*/
function pasuser(form) {
<!--//under: change your own ID
if (form.id.value=="ID") { 
<!--//change your own login-code
if (form.pass.value=="something") {              
<!--//change the page that is secured
location="http://thing.com" 
} else {
alert("Invalid Password")
}
} else {  alert("Invalid UserID")
}
}
//-->
</script>

</head>

<body bgcolor="#000000" text="#00FF00" link="#CCFFCC" vlink="#008000">

<center>
<table bgcolor="#FFFFFF" cellpadding="4" border="1">
<tr><td colspan="2" align="center" height="22" width="282"><p><font size="3" color="#000000">Login
Area</font></p></td></tr>
<tr><td align="center" height="24" width="84"><p><font size="3" color="#000000">User ID:</font></p></td><td align="center" height="24" width="170"><form name="login"><font size="3" color="#000000"><input
name="id" type="text"></font></td></tr>
<tr><td align="center" height="24" width="84"><p><font size="3" color="#000000">Password:</font></p></td><td align="center" height="24" width="170"><font size="3" color="#000000"><input name="pass"
type="password"></font></td></tr>
<tr><td align="center" height="1" width="84"><font size="3"><input type="button" value="Login"
onClick="pasuser(this.form)"></font></td><td align="center" height="1" width="170"><font size="3"><br><input
type="Reset"></form></font></td></tr></table></center> 

</body>

</html>
But: : Secure your source code (google: no right-click and copying of text), otherwise your password-protector does not work (password in source code)!

I hope this will help you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 10th, 2006, 20:12
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

That is possibly the least secure way to secure a site!
SO easily hacked...

You need a server side scripting language such as PHP or ASP, does your host support any of them?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 10th, 2006, 20:47
Up'n'Coming Member
Join Date: Jan 2006
Location: Belfast
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Hi,

Thanks AnneJan for your suggestion - but I will need a fairly secure version - but I do appreciate it!

Benbacardi - yes it does support them (as far as I am aware). What step do I take next?!

Thanks again!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 10th, 2006, 21:09
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

well, which does your host support? PHP, or ASP? they will most likely support one in full, and if its a PHP host i cud also support a watered-down version of ASP.

Once you know which language, go head over to that forum, read articles etc!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 10th, 2006, 21:13
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Yes there are some really terrible 'secure' sites out there from web design cowboys.

Credit card info sent to emails among others :s
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 10th, 2006, 22:08
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 26
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Take a look at an article I wrote for another member that was after the same sort of thing here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jan 11th, 2006, 04:54
Junior Member
Join Date: Jan 2006
Age: 25
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Hey tim i looked over the article, but how are you storing the information? It looks like they have to login after each visit.

Also, you dont need to use MySQL for doing this really. If you set up a config file with an array of users and passes, it is usually most efficient for SMALL scale admin areas. You can even go as far as to drop them into an associative array with user levels. Then, the great thing is, if in the future you need to upgrade to database control, you can just drop your result into and array and nothing in your script has to change.

Also, the guy that mentioned the javascript is totally a bad idea. NEVER use javascript for trying to create secure login scripts. It doesnt work buddy. You need to use PHP, dont get involved with asp, its "A Sorry Program" developed my ms. PHP is free and almost ALL standard hosts offer it free with hosting. I think something like 60% of the internet is made up of LAMP (Linux Apache MySQL and PHP) all free programs that anyone can install on almost all platforms, well at least the AMP part.

just my 2 cents.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jan 11th, 2006, 10:12
Tim356's Avatar
Reputable Member
Join Date: Nov 2003
Location: Australia
Age: 26
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Hi rproctor, where am I storing the info? As I mentioned in the tutorial, you'd create a session to store the login details after the user has been authenticated - this is relatively easy but outside of the scope of the article. If you like, I can write an article about sessions that would explain everything. Let me know and I'll get to work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jan 11th, 2006, 13:27
Junior Member
Join Date: Jan 2006
Age: 25
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

I know what sessions are, how to use them, and all that good stuff. I was just curious because I didnt really read the article, I just skimmed over the code and I didnt see any code that stored the login information. Regardless though, sessions are probably the best way to store information
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jan 11th, 2006, 15:47
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Quote:
You need to use PHP, dont get involved with asp, its "A Sorry Program" developed my ms.
Ah, the good old php/asp debate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jan 11th, 2006, 16:18
Junior Member
Join Date: Jan 2006
Age: 25
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

I just dont get why ASP is so big. If you look at asp coming from a language like java, php, etc it doesnt make sense, well to me at least. It took me a while to grasp the structure of it, and as little as I know about asp the one thing I do know is that I dont really like it. PHP has so much better support, programs, etc. Even most windows server run php, or I think they do, compared to windows servers running asp. I dont know, asp is probably very powerful, and can do a lot of the same things if not more than php, but the time and resources it takes to develop in asp are a lot larger.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jan 13th, 2006, 08:16
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

How about .htaccess?
I just made a members area for my rugby team, doing something very similar to what Tim356's article says to do. Mine is a little different though. When someone registers, all the information is put into a table called "wannabe", when they register, an email is sent to me telling me someone wants to be a member. I then go to the page that will call this info from the table. I look at it and if they are qualified to be a member, I submit this info from the wannabe table and it is inserted into the "members" table. Then an email is sent to the person telling them that they are now a member. Then the info in the wannabe table is deleted.
Basically the difference between mine and Tim's is that Tim's simple registration is just that, the basics, but then anyone could register and become a member. With mine, an admin has to accept the application to become a member.
When a member signs in, I set a session cookie. I then put a script at the top of each page, if the cookie doesn't say they are logged in, they get redirected to the login page.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jan 13th, 2006, 13:30
Junior Member
Join Date: Jan 2006
Age: 25
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

You could just make a field in the database called "active" and set it to default to 0, then if they are qualified set it to 1. Thats how I do most of my admin controls.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Jan 13th, 2006, 20:59
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Good idea. Maybe in future members areas I will do something similar. For now, that would take a lot of rewriting to do, more than I'm willing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Jan 13th, 2006, 22:51
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

Quote:
Originally Posted by rproctor
. You need to use PHP, dont get involved with asp, its "A Sorry Program" developed my ms. PHP is free and almost ALL standard hosts offer it free with hosting.
your one of these people who have no idea what their on about. have u ever used asp or .net?

and back on topic, search for a post somwhere where me and tim added both asp and php login tutorials...should help you out...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Jan 13th, 2006, 23:53
Junior Member
Join Date: Jan 2006
Age: 25
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

I never said it wasnt powerfull, or that it doesnt have its perks, but unless you need asp for a specific task, then what is really the point of using? For one its not free, and the scripting structure is complicated to anyone who isnt familiar with programming. A newbie who has no programming skills can pick up php, plus php is super powerful. And I know what I am on about, I have been about it for many years lol.

All I know about asp is that it costs $$$ and I could use PHP to do the same things for free. If php cant handle it, then Im sure that mixing in some ajax will take care of whatever it is.

True I have never used asp, only fiddled with it a couple of times when I needed to fix something on my buddies website. Other than that, no idea how it works. But for this guy who posted this topic, im 99% positive he should go with php!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Jan 13th, 2006, 23:59
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how to create a members only page

well, i use BOTH php and asp - i actually can give an informed answer here.

yeah, classic asp is useless, its in comparason with php3, but .net is almost as good as php. In my opinen, php is in some ways better then asp, but people who have never used it cant really make the point...