4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Looking for single password login script
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
m7d7g7
Junior WebHelper
Junior WebHelper


Joined: 10 Dec 2003
Posts: 4

PostPosted: Fri Dec 12, 2003 3:08 am (14 years ago) Reply with QuoteBack to Top

ok.. it's still not working. Confused I will tell you exactly what happens. when i go to my login.html [with just the login form] and enter the password 'pass' i'm redirected to the blank login.php [the script]. Thats it. If i navigate to the page that i'm protecting it says "You cannot view this page." even though i entered the password. It it helps i only want to pass protect one page. are you sure the code is ok? I tried a bunch of diffrent stuff and cant seem to get it figured out.
OfflineView User's ProfileFind all posts by m7d7g7Send Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Fri Dec 12, 2003 4:34 pm (14 years ago) Reply with QuoteBack to Top

hmm, now that I think about it, you may need to put session_start(); at the top of all the pages (after <?php)

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
m7d7g7
Junior WebHelper
Junior WebHelper


Joined: 10 Dec 2003
Posts: 4

PostPosted: Fri Dec 12, 2003 9:24 pm (14 years ago) Reply with QuoteBack to Top

nope.. that doesnot work either. I searched around for a script on hotscripts, but couldnot find any that were just a single password to enter. Rolling Eyes
OfflineView User's ProfileFind all posts by m7d7g7Send Personal Message
Nebooaw
Junior WebHelper
Junior WebHelper


Joined: 17 Dec 2003
Posts: 1

PostPosted: Wed Dec 17, 2003 12:07 pm (13 years, 12 months ago) Reply with QuoteBack to Top

Hi, i have tried you example as it is almost what i need but i just get Undefined index: whenever i run the pages before i enter in a password.
The redirect page comes up when a valid password is entered but the same message again Undefined variable: _SESSION.

Any ideas?

Can you show me how to use this code with a flat file containing a password and username? When someone enters a valid password the redirect page says "welcome Pete"?

Kindest thanks.
OfflineView User's ProfileFind all posts by NebooawSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Wed Dec 17, 2003 6:28 pm (13 years, 12 months ago) Reply with QuoteBack to Top

if $_SESSION is undefined, chances are you're using an old version of php. try $HTTP_SESSION_VARS instead.

to use a file containing a username/pass, the easiest (and best) thing to use would be HTTP Authentication

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   


Go to page Previous  1, 2

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.057728 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme