Jump to content

php script for onlogin image change


mrjameer

Recommended Posts

hi syed,

iam developing a website.on main page i have one red button image on header.below that login box.when i enter username/password it will display welcome message on the same page(other web contents should remain same)  and on the same page the red button image should change to green button image.

second, once the user login,if i open the same page in other browser it should display the green button image(means user is online like that)

jameer
Link to comment
Share on other sites

hi,

iam developing a web site with online customer service feature.
1.when a customer opens my site then he should see the red button image on header(means the sales operator is not available like that)which is default.

2.when the sales operator is logged in then the red button image should change to green button image  on main page(means that operator is online).

3.when second customer open our site,after sales operators login, he should see green button image(means he can chat with the operator) and  similarly when sales operator logged out then the green button image should change to red one.

i have login script but when i test the condition of after login image should change,its not working.after login red button as it is.i want to do this with php/javascript...

thanks

mrjameer
Link to comment
Share on other sites

dude.. you've been given an example. From that example you can tell what needs doing..

[code]<?php

if ($user->isLoggedIn()) {
    if ($user->isOperator()) {
        $image = 'pink with yellow pokadots';
    } else {
        $image = 'green'; //display green image
    }
} else {
    $image = 'red'; //display red image
}

?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.