mrjameer Posted September 3, 2006 Share Posted September 3, 2006 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 mejameer ??? Quote Link to comment Share on other sites More sharing options...
syed Posted September 3, 2006 Share Posted September 3, 2006 Hi please explain a bit more, whats the image, how do you want it to change, when should it change? Quote Link to comment Share on other sites More sharing options...
mrjameer Posted September 3, 2006 Author Share Posted September 3, 2006 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 Quote Link to comment Share on other sites More sharing options...
acdx Posted September 3, 2006 Share Posted September 3, 2006 [code]<?phpif( user is logged in ) echo("<img src=\"green.gif\" />");else echo("<img src=\"red.gif\" />");?>[/code] Quote Link to comment Share on other sites More sharing options...
mrjameer Posted September 4, 2006 Author Share Posted September 4, 2006 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 Quote Link to comment Share on other sites More sharing options...
Jenk Posted September 4, 2006 Share Posted September 4, 2006 dude.. you've been given an example. From that example you can tell what needs doing..[code]<?phpif ($user->isLoggedIn()) { if ($user->isOperator()) { $image = 'pink with yellow pokadots'; } else { $image = 'green'; //display green image }} else { $image = 'red'; //display red image}?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.