Archive

Posts Tagged ‘sessions login redirection’

Php Sessions Login Redirection

June 29th, 2009 Comments off

Working on an intranet project and not experienced enough with sessions. My project deals with the login portion and the emailing of links. I have created some pages, but open to changes as long as the page layout stays the same. Here are the details.

The user will get a link within the email that corresponds to a project. When the user clicks the link, I want to see if the user is logged in, if yes, direct them to the page. If not, redirect them to the login page, when completed with the login page, redirect them back to the corresponding project link.

In example, the user is emailed the link http://intranet/hd/view_project.php?id=8, when the user clicks the link the system checks to see if the user has a valid session id, if not it redirects him to the login page. After he completes the login page, he is then redirected to the above link. If he already has a valid session id, he is just simply directed to the above link.

I would prefer that the script be in the form of a function, not sure if that is the practical solution. There are two zip files attached to the project, one is the current php pages for the login, the other is the images for the pages. I’m connecting everything to a mysql server which I’m currently running on my development machine.

Bear