?
Solved

How can I re-direct unauthorised visitors?

Posted on 2003-10-27
3
Medium Priority
?
202 Views
Last Modified: 2006-11-17
I am developing my 1st php solution for my own use (To manage my accounts etc). I am providing users with a username and password which I am validating by checking their data in the relevent mySql tables. This is no problem.

The problem I have is that once they succesfully log in I want to create some sort of identifier that means if they try to go straight to one of the pages without 1st logging in I want them directed back to the login screen.

This project works like a web based control panel.

Cheers in advance
0
Comment
Question by:08718712060
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
errows earned 1000 total points
ID: 9627840
Use sessions.
When they login, set their username as a session variable.
On every page, test that session variable, if it is not set, redirect the user to the login page.

Good session tutorial:
http://www.zend.com/zend/tut/session.php
0
 

Author Comment

by:08718712060
ID: 9627984
Great,
Its easy when you know how but a quick learning curve. Good fun though :-)
Cheers for your help.

Stu
0
 

Expert Comment

by:icb01co1
ID: 9642125
Dont sessions annoy search engines?? Is there another way around this problem?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question