Web Design and Development Forums

[SOLVED] Show "Image" Depends On User "Status"?

This is a discussion on "[SOLVED] Show "Image" Depends On User "Status"?" within the ASP Forum section. This forum, and the thread "[SOLVED] Show "Image" Depends On User "Status"? are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Oct 8th, 2007, 04:50   #1 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,566
Blog Entries: 2
Send a message via Yahoo to Monie
[SOLVED] Show "Image" Depends On User "Status"?

Hai guys,

Is it possible if I want to show 2 different kind of image (for example: online and offline gif) depends on the "status" of the user?

In my page, when the user login, it will set the user "status" (a field in my database) to be "Online" and when he logout, it will set the "status" to "Offline".

So when the user has logged in, I want to display the Online.gif just beside the user name. Just like a toggle function in javascript.

Code: Select all
if "status" == Online {
display "online.gif"
}
else
display "offline.gif"
If this things can be done in any other way other that javascript, please tell me,

Thanks....
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 8th, 2007, 09:45   #2 (permalink)
 
Rakuli's Avatar
 
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 980
Blog Entries: 2
Re: Show "Image" Depends On User "Status"?

Hi monie,

What type of server side scripting do you have available? You can't achieve this with javascript alone as javascript has no knowledge of what other user's are up to.

If you have PHP, I can help you. Let me know and I'll move this thread over there.

Cheers,
__________________
Rakuli

Helping you expand your epiphanies:

pen Source of pen Thoughts
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 9th, 2007, 00:51   #3 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,566
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Show "Image" Depends On User "Status"?

I am using ASP (..currently learning PHP-WAMP)

If you can teach me using PHP, go on. I'll learn by doing. If you know the ASP way, maybe it will be easier for me to understand...

Thanks by the way...
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 12th, 2007, 15:58   #4 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,566
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Show "Image" Depends On User "Status"?

Any thing so far Rakuli?
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 12th, 2007, 21:15   #5 (permalink)
 
Rakuli's Avatar
 
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 980
Blog Entries: 2
Re: Show "Image" Depends On User "Status"?

Hi Monie, sorry I missed this one. If you have a look at PHP Recources for Beginners it has some links to PHP starter tutorials but it may be easier for you to see the ASP way

Moving to the ASP forum
__________________
Rakuli

Helping you expand your epiphanies:

pen Source of pen Thoughts
Rakuli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 15th, 2007, 09:18   #6 (permalink)
Up'n'Coming Member
 
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: Show "Image" Depends On User "Status"?

Hi Monie,

Is this for a forum kind of "User Online"? if so you will need to flag it in the database, if you just want an image to show to the user that is logged in then you can just use a session variable and us the following:-

Code: Select all
<%If Session("svUserName") <> "" Then%>
Code for the online image goes here......
<%Else%>
Code for the offline image goes here......
<%End If%>
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Oct 16th, 2007, 01:22   #7 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,566
Blog Entries: 2
Send a message via Yahoo to Monie
Re: Show "Image" Depends On User "Status"?

Yes, I did it. Thanks robbied.

Code: Select all
<%
    Session("userStatus") = rs("status")
    If Session("userStatus") = "Online" Then
        Response.Write ("<img src=img/online.gif>")
    Else
        Response.Write ("<img src=img/offline.gif>")
    End If
%>
__________________


Last edited by Monie; Oct 16th, 2007 at 05:09.
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
? IS "meta name="robots" content="?" necessary in pages ? Love2Java New to Web Design 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09
"Exit" or "Goto End" equivalent? Donny Bahama ASP Forum 6 Nov 8th, 2006 12:23
<option value="yes" class="x"> problem in Firefox mameha1977 CSS Forum 1 Jun 21st, 2006 11:20
Need to build a "Trip" or "Journey Planner" jswebdev PHP Forum 4 Dec 5th, 2005 23:22



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 05:24.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59