Password Page [message #116079] |
Wed, 22 September 2004 15:41 |
|
glyde51
Messages: 1827 Registered: August 2004 Location: Winnipeg
Karma: 0
|
General (1 Star) |
|
|
How can I password protect a page on my site so you only need a password to enter it, not a username? Anyone know?
No user name, just password protected.
No. Seriously. No.
|
|
|
Password Page [message #116080] |
Wed, 22 September 2004 15:43 |
|
xptek
Messages: 1410 Registered: August 2004 Location: USSA
Karma: 0
|
General (1 Star) |
|
|
Google .htaccess.
cause = time
|
|
|
Password Page [message #116081] |
Wed, 22 September 2004 15:44 |
|
glyde51
Messages: 1827 Registered: August 2004 Location: Winnipeg
Karma: 0
|
General (1 Star) |
|
|
ctrl+7
No. Seriously. No.
|
|
|
Password Page [message #116082] |
Wed, 22 September 2004 15:48 |
|
glyde51
Messages: 1827 Registered: August 2004 Location: Winnipeg
Karma: 0
|
General (1 Star) |
|
|
Well, does anyone know a simple way to do this like a java script or something?
No. Seriously. No.
|
|
|
|
Password Page [message #116090] |
Wed, 22 September 2004 16:05 |
|
glyde51
Messages: 1827 Registered: August 2004 Location: Winnipeg
Karma: 0
|
General (1 Star) |
|
|
Yeah, I host it myself. But a java script or something is better. Just something that doesn't need a user name and works for one page only.
No. Seriously. No.
|
|
|
Password Page [message #116097] |
Wed, 22 September 2004 16:28 |
|
Madtone
Messages: 713 Registered: February 2003 Location: United Kingdom
Karma: 0
|
Colonel |
|
|
Ok, heres a basic page for you, name it index.php
<?
//the password
$the_pass = "pass123";
if ($action == "login") {
if ($_POST['pass'] == $the_pass) {
//set them as logged in
$_SESSION['pass'] = $the_pass;
}else{
echo "wrong password, please hit back";
}
}else{
//checks if you have typed in the pass
if ($_SESSION['pass'] == $the_pass) {
//your page content goes here
echo "
<html>
<head>
<title>my page - members section</title>
</head>
<body>
welocme to members section
</body>
</html>
";
}else{
//login page goes here
echo "
<html>
<head>
<title>my page - login</title>
</head>
<body>
<form action='index.php?action=login' method='post'>
Username:<br>
<input type='text' name='pass'>
<p></p>
<input type='submit' name='submit' value='Login'>
</form>
</body>
</html>
";
}
}
?>
I just wrote this from scratch just now, so they're might be errors, basicly this is just a quick script that checks if the pass session is registered and if it is, does the pass match the supplied pass.
If you want something more secure i suggest mySQL, sessions and MD5 encryption.
If you would like me to code you a proper login and user management system i have low prices.
Hope this helps
[Updated on: Wed, 22 September 2004 16:33] Report message to a moderator
|
|
|
|
Password Page [message #116107] |
Wed, 22 September 2004 17:21 |
|
glyde51
Messages: 1827 Registered: August 2004 Location: Winnipeg
Karma: 0
|
General (1 Star) |
|
|
Can someone point me in the direction of some stuff I can put on it? I host it myself. Maybe like a chat applet and a guestbook. Thanks.
No. Seriously. No.
|
|
|