Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I re-direct unauthorised visitors?

Posted on 2003-10-27
3
Medium Priority
?
204 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

610 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