Current location: Hot Scripts Forums » Programming Languages » PHP » acessing password protected folder


acessing password protected folder

Reply
  #1 (permalink)  
Old 09-24-03, 12:34 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
acessing password protected folder

Hi, i have this script for user auth.

Q1. How can I make multipule passwords without using a db
A2. How can i protect pages so that they can only access it when they have logged in.

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

<?php
@ $name = $HTTP_POST_VARS['name'];
@ $password = $HTTP_POST_VARS['password'];
if(empty($name) ||empty($password))
{
?>
Pilots login here.

<form method="post" action="pilots/index.php">
Username
<input type="text" name="name" size="10">
Password
<input type="text" name="name" size="10">
<input type="submit" value="Log In">
</form>
<?php
}
else if($name=='@users'&&$password=='@passwords')
{
echo'You have sucessfully loged in';
}
else
{
echo'Sorry Username/Password is incorrect';
}
?>
Reply With Quote
  #2 (permalink)  
Old 09-26-03, 08:36 PM
SleeperZ SleeperZ is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Without using a database you would be forced to use an array,

I would suggest an array within an array, so you in fact are using 3 arrays in total. 1 your main array, 2, your Username array 3, your corresponding Password array.

To make sure they login, requires the use of sessions. Session variables throughout your site can help ensure that the user logged in has access to whatever you designate him / her to look at.

I hope this helps, if you require consultation on this in any further depth please feel free to contact me.
__________________
***Expect the Unexpected***
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
edit php in Squirrelmail jrcortrightiii PHP 1 07-10-03 02:08 PM


All times are GMT -5. The time now is 06:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.