Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » Password Page
Password Page [message #116079] Wed, 22 September 2004 15:41 Go to next message
glyde51 is currently offline  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 Go to previous messageGo to next message
xptek is currently offline  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 Go to previous messageGo to next message
glyde51 is currently offline  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 Go to previous messageGo to next message
glyde51 is currently offline  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 #116086] Wed, 22 September 2004 15:57 Go to previous messageGo to next message
Madtone is currently offline  Madtone
Messages: 713
Registered: February 2003
Location: United Kingdom
Karma: 0
Colonel
Does your host support PHP, if yes i can help.

http://www.freeflow-solutions.com/sigs/ffsig.gif
Password Page [message #116090] Wed, 22 September 2004 16:05 Go to previous messageGo to next message
glyde51 is currently offline  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 Go to previous messageGo to next message
Madtone is currently offline  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 Wink


http://www.freeflow-solutions.com/sigs/ffsig.gif

[Updated on: Wed, 22 September 2004 16:33]

Report message to a moderator

Password Page [message #116098] Wed, 22 September 2004 16:31 Go to previous messageGo to next message
glyde51 is currently offline  glyde51
Messages: 1827
Registered: August 2004
Location: Winnipeg
Karma: 0
General (1 Star)
okay, thanks Very Happy

No. Seriously. No.
Password Page [message #116107] Wed, 22 September 2004 17:21 Go to previous message
glyde51 is currently offline  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.
Previous Topic: Big-ass Wave
Next Topic: Website Tips
Goto Forum:
  


Current Time: Mon Nov 04 04:22:45 MST 2024

Total time taken to generate the page: 0.00848 seconds