how can i do this??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

how can i do this??

Post by azycraze »

hi , i have a small cms created of my own which is controlled from single index.php.
I have created some articles which can be accessed only by logged in members.
So if a guest visit for example "http://example.com/article/how-can-i-do-it.php"

he is redirected to the http://example.com/login.php

All i need is when user login from this page , he should be taken to "http://example.com/article/how-can-i-do-it.php"

In normal case when user logins,they are redirected to http://example.com/.

plssss help! :(
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: how can i do this??

Post by social_experiment »

So you want the page accessed when not logged in to be the page you are directed to if you do log in?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: how can i do this??

Post by Celauran »

Store the requested URL in session data and redirect to it after logging in.
User avatar
azycraze
Forum Commoner
Posts: 56
Joined: Mon Oct 24, 2011 12:08 pm
Location: India

Re: how can i do this??

Post by azycraze »

can i use

$_SERVER['REQUEST_URI']

for this
Post Reply