TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-22-2010, 04:31 PM   #1 (permalink)
The Visitor
Newcomer 
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
ricarubio is on a distinguished road
Default Log-in with access type

Hi can someone help me with this problem.

I have two username and password with an additional field called access level.
For the sake of this explanation lets call them:
admin - abc password - page1.php and page2.php
guest- xyz password - page2.php

I have a page called 'index.php' wherein i will input my username and password. I also have a 'page1.php' and 'page2.php'I want the admin to access 'page1.php' and 'page2.php'.. While the guest can only access the 'page2.php'.
ricarubio is offline  
Reply With Quote
Old 03-22-2010, 06:40 PM   #2 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

This is a rather enormous question by itself. Have you made any headway into setting the script up? If so, you may have better luck asking questions to specific to the stage of development you are currently in. We won't write the entire script for you, so we need to have some angle to approach in helping you.

You're going to want to look into form handling to start. That includes checking values for integrity and correct types. Then you're going to want to learn how to use sessions and/or cookies to maintain the information for a logged in user.
delayedinsanity is offline  
Reply With Quote
Old 03-22-2010, 07:35 PM   #3 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

ricarubio, Posting in two different sections.
Wont get you help faster. So please choose one section and stick to that one.

Thank you.
codefreek is offline  
Reply With Quote
Old 03-24-2010, 02:48 AM   #4 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

A simple way of doing this would be to store the admin information in a database (or file if you don't have access to a database). Then on the index.php (or what ever page is loaded by default) check to see if the user has a cookie (a small bit of information that is can be stored on each connecting computer) with a correct [pseudo]random string.

If the strings match you can assume that the connecting user has either copied the data or is an admin. If the user appears to be valid you could send them to page1.php (where you would want to validate again) or if they don't then off to page2.php.

If you have any specific questions (or about the flow of a basic authentication system) don't hesitate to ask.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Access Date problems. mtsang Absolute Beginners 4 06-27-2009 04:59 PM
How do I design my access control system ? amitdgr General 4 04-21-2009 09:21 AM
MS Access via FTP Jenski Advanced PHP Programming 3 02-04-2009 03:27 PM
Using Type Juggling/Type Casting to Modify Data Types Wildhoney Tips & Tricks 6 11-30-2007 02:44 AM


All times are GMT. The time now is 02:49 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design