redirect page

8 views
Skip to first unread message

Ghulam Mustafa Bajwa

unread,
Sep 4, 2013, 6:33:02 AM9/4/13
to xamp...@googlegroups.com
I have a page called plans.php, inside I have three links (Plan 1, Plan 2, Plan 3). Each link has its own page and it redirects to login page (login.php, which works fine). So if the user is not logged in when they click lets say on "Plan 2" it will force the user to login so they can see the desired page, all depends of what "Plan" the user chooses.

without lo-gin  he can't see the page whether clicked,and if i m  clicking on plan 2.php then it will redirect to login page and after lo-gin  i want to redirect on  it on plan2.php.

Ram Janam

unread,
Sep 4, 2013, 9:22:29 AM9/4/13
to xamp...@googlegroups.com
on the login page when you login then you should set a session like:
$_SESSION['user_id']="$user_id";

and then on every page check a condition;

if($_SESSION['user_id']==''){
header('loaction:login.php');
}


On Wed, Sep 4, 2013 at 4:03 PM, Ghulam Mustafa Bajwa <arto...@gmail.com> wrote:
I have a page called plans.php, inside I have three links (Plan 1, Plan 2, Plan 3). Each link has its own page and it redirects to login page (login.php, which works fine). So if the user is not logged in when they click lets say on "Plan 2" it will force the user to login so they can see the desired page, all depends of what "Plan" the user chooses.

without lo-gin  he can't see the page whether clicked,and if i m  clicking on plan 2.php then it will redirect to login page and after lo-gin  i want to redirect on  it on plan2.php.

--
Ask New Question from : https://groups.google.com/forum/?fromgroups#!newtopic/xamppdev
 
Create filter of mails from this group http://www.wikihow.com/Create-a-Filter-in-Gmail
---
You received this message because you are subscribed to the Google Groups "PHP Developers' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xamppdev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xamppdev/376e4913-67d2-4d7a-abe3-d1d95569b9d2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Ramjanam

Ghulam Mustafa Bajwa

unread,
Sep 5, 2013, 1:16:46 AM9/5/13
to xamp...@googlegroups.com
its work fine. so many thanks Ramjanam


Reply all
Reply to author
Forward
0 new messages