Archive

Posts Tagged ‘the above link’

Php Login W/ Sessions/redirect

July 21st, 2009 Comments off

I have created a website that I’m having troubles getting to work correctly. I have created a login script that works without troubles, but I can’t seem to get the redirect to work. I prefer not to use cookie or javascript, just want to use PHP sessions.

Scope of work is below with example.

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.

You can modify my code or change to something you have experience with, I don’t care, but it’s got to work. I have attached all the files that will be needed to complete the project. I’m currently developing this website using php 5.2.1 and using mysql 5.0.22 on a windows based machine.

Must be able to communicate via email in timely manner.

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