PHP Applications
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Applications

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 Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old May 7th, 2007, 08:01 AM
lordchriz lordchriz is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Dumaguete City, Oriental Negros,Philippines
Posts: 26 lordchriz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 55 m 55 sec
Reputation Power: 0
Send a message via Yahoo to lordchriz
How do i check if user is logged on or not?

i would like to echo different links on each page depending on if the user is logged on or not,
e.g "log on" or "register" if they are not and "change style" if they are,
how do i do this?

thanks..
__________________
im lve web designing

Reply With Quote
  #2  
Old May 7th, 2007, 03:20 PM
bobisnotmyuncle bobisnotmyuncle is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 69 bobisnotmyuncle User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 23 h 53 m 24 sec
Reputation Power: 2
I think you might want to use the $_SESSION superglobal to do this maybe...

Reply With Quote
  #3  
Old May 7th, 2007, 09:33 PM
lordchriz lordchriz is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Dumaguete City, Oriental Negros,Philippines
Posts: 26 lordchriz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 55 m 55 sec
Reputation Power: 0
Send a message via Yahoo to lordchriz
hello

can you give me sample for this script please..

Reply With Quote
  #4  
Old May 8th, 2007, 01:16 AM
KKmaddog KKmaddog is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 63 KKmaddog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 18 m 28 sec
Reputation Power: 2
how is your log in set up? when i say that is how do you tell when the user is logged in our not, that is if you have it set up in the 1st place. If not you would parse the user input and check it against the records in the db if everything is set then you would assign the username to a $_SESSION var.
PHP Code:
 $_SESSION['user_name'] = $username_they_entered


now if you are testing whether they are logged in or not you would simply go
PHP Code:
if(isset($_SESSION['user_name']))
{
//print something you only want the person logged in to see
//maybe there username
print "Welcome $_SESSION['user_name']" ;
}
else
{
print 
'Welcome Guest. Would you like to register?' ;

__________________
I drunk red bull and grew wiings!!!

Reply With Quote
  #5  
Old May 8th, 2007, 02:00 AM
lordchriz lordchriz is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Dumaguete City, Oriental Negros,Philippines
Posts: 26 lordchriz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 55 m 55 sec
Reputation Power: 0
Send a message via Yahoo to lordchriz
ok thank you, it really help me a lot

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Applications > How do i check if user is logged on or not?


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 1 hosted by Hostway