General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 27th, 2003, 08:37 PM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 116 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 49 sec
Reputation Power: 6
registering session

Hi guys,

I am wondering is there any easier/faster way for me to register the variables in a session.

my code:
if($login_check >0){
while ($row = mysql_fetch_array($sql))
{
//user inserted username
session_register('username');
$_SESSION['username'] = $username;
//get data from db
$last = $row['last_login'];
session_register('last');
$_SESSION['last'] = $last;
$status = $row['status'];
session_register('$status');
$_SESSION['status'] = $status;
mysql_query("UPDATE info SET last_login = now() WHERE username = '$username'");
include "main.php";
}

Hope you guys can give me some idea about the alternative ways to perform such tasks.

Thank you.

Reply With Quote
  #2  
Old October 28th, 2003, 01:24 AM
Taelo Taelo is offline
5B's
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: PC, FL
Posts: 366 Taelo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 59 sec
Reputation Power: 7
This is not needed.

PHP Code:
 session_register('username'); 


simply using the $_SESSION[] global array will work just fine

you could simply your code as well.

PHP Code:
 $_SESSION['last'] = $row['last_login']; 


hope it helps

ps. I would read Laidbak's post on Register Globals

http://www.devarticles.com/forum/sh...=&threadid=4391
__________________
-- Jason

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > registering session


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT