Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    changing the image onlogin

    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

  • #2
    New Coder
    Join Date
    Sep 2006
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This can be done using ajax and make request every 30 seconds or something. What you need to do is:

    - A php script which will return 0 (operator is available) or 1 (operator is unavailable). 0 or 1 can be whatever but the shorter the faster.
    - On the main page, make request to that php script via ajax and update the image through dom.
    so happy, so cool

    http://coolersport.info


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •