Jump to content

Archived

This topic is now archived and is closed to further replies.

mrjameer

php script for onlogin image change

Recommended Posts

hi

i want to change the image of a webpage on user login using php.bydefault i have some other image on my webpage.after user login when i open this web page in some other browser i need the second image..how to do it help me

jameer
???

Share this post


Link to post
Share on other sites
Hi please explain a bit more, whats the image, how do you want it to change, when should it change?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[code]
<?php
if( user is logged in )
  echo("<img src=\"green.gif\" />");
else
  echo("<img src=\"red.gif\" />");
?>
[/code]

Share this post


Link to post
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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.