PHP

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentPHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old September 8th, 2015, 07:53 AM
manojrawat77 manojrawat77 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Sep 2015
Posts: 4 manojrawat77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 7 sec
Reputation Power: 0
How to redirect the User to a particular Page after login ?

I have created login Page for user to access the website. If the login has been successfully completed by the User, then user should redirect to a specific page. I want to know how can I achieve this. I have explored few PHP questions and answers community but still looking for exact solution.

Reply With Quote
  #2  
Old August 16th, 2016, 05:26 AM
jameswarner jameswarner is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Aug 2016
Posts: 3 jameswarner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 31 sec
Reputation Power: 0
PHP Redirect to Selected Page After Login

Here is a snippet of my code in the login page:

if (mysql_num_rows($result_set) == 1) {
// username/password authenticated
// and only 1 match
$found_user = mysql_fetch_array($result_set);
$_SESSION['user_id'] = $found_user['id'];
$_SESSION['username'] = $found_user['username'];
$_SESSION['last_activity'] = time();
$_SESSION['time_out'] = 7200; // 2 hours
redirect_to("index.php");

Reply With Quote
  #3  
Old January 25th, 2017, 04:14 AM
dishagandhi dishagandhi is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Dec 2016
Location: Ahmedabad
Posts: 52 dishagandhi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 40 m 42 sec
Reputation Power: 1
Check for session

Hi,
You can check if session is active or not.
if activbe than you can use header("location:yoururl");
Thanks

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentPHP > How to redirect the User to a particular Page after login ?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap