Current location: Hot Scripts Forums » Programming Languages » PHP » How to keep auser active while visiting web pages


How to keep auser active while visiting web pages

Reply
  #1 (permalink)  
Old 08-08-09, 10:41 AM
u192973 u192973 is offline
Newbie Coder
 
Join Date: Aug 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
How to keep auser active while visiting web pages

Hello All!

So I know about session_start(); but do i need to do anything else to transfer the users information? Because what happens when I created a back to home page button, when you click on it, it returns to the index page, not the user page. ?? Am I not passing things correctly. how do I put go back to users memberpage in php with them still logged in?

Thank you!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-08-09, 08:57 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
You need to keep track of the user_id in a session variable, after they log in.

Please post your code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-09-09, 10:23 PM
u192973 u192973 is offline
Newbie Coder
 
Join Date: Aug 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

<?php

session_start
();
// If magic quotes is turned on then strip slashes
if (get_magic_quotes_gpc()) {
  foreach (
$_POST as $key => $value) {
    
$_POST[$key] = stripslashes($value);
  }
}
I also have:

PHP Code:

 $_SESSION['username'] ); 

Does that need to be on every page.?

Thank you for responding!

Last edited by wirehopper; 08-10-09 at 06:28 AM. Reason: PHP tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-10-09, 06:28 AM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,516
Thanks: 20
Thanked 109 Times in 106 Posts
You need to set 'username' after they log in.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
back button, button, php, session


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nixism | Affordable/Reliable Web Hosting: cPanel, Fantastico, PHP 5, Ruby.. more!! .amaZe General Advertisements 0 06-04-07 09:02 PM
Outsourcing web design to Bulgaria - Marin Todorov gal_flower Job Offers & Assistance 4 02-14-06 09:05 PM


All times are GMT -5. The time now is 01:33 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.