Basic PHP question

Discussion in 'PHP' started by ker, Mar 23, 2012.

  1. #1
    Hi, i wanted to ask if it is possible to send data to browser without browser request. For example, i have mail.google.com open in browser and when I receive new mail, popup shows. Is that ajax loop checking if new mail arrived or it is possible like I asked. Also, is it possible that browser makes request and server doesn't respond until there is new mail? Is there time limit using ajax?
    Thank You!
    :)
     
    Solved! View solution.
    ker, Mar 23, 2012 IP
  2. ssmm987

    ssmm987 Member

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    3
    Trophy Points:
    43
    #2
    No, that's not possible
    Not possible either. With every request that is made, the server needs to handle the request in order to check if there is a new mail. However it is possible to send a blank response.
    What do you mean by time limit?
     
    ssmm987, Mar 23, 2012 IP
  3. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #3
    I dont understand all your ideas, but I think if you use SetTimeout to set time to re-check email by PHPMailer function. So why do not you try it? Wait for your result!
     
    kids, Mar 23, 2012 IP
  4. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    I mean if browser makes new XMLHttpRequest, is there any time limit in which server needs to response.
    I'm asking this in case there is any kind of response postponement from server. So, server would response when new mail arrived.
     
    ker, Mar 23, 2012 IP
  5. yho_o

    yho_o Well-Known Member

    Messages:
    354
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    #5
    Yes you can set timer to send request for example every 1 minute to the server

    using jquery $.post, $.ajax methods will make it alot easier for you, instead of making loooong poor ajax requests and handle internet explorer problems yourself
     
    yho_o, Mar 23, 2012 IP
  6. phapit

    phapit Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Maybe he's asking about the server/browser timeout? Like if the server doesn't respond in 5 minutes, what happens?
     
    phapit, Mar 24, 2012 IP
  7. yho_o

    yho_o Well-Known Member

    Messages:
    354
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    #7
    by long i mean hard to be remembered
     
    yho_o, Mar 24, 2012 IP
  8. #8
    No server side program will update the client side content without any request from the browser. It is just the ajax thread which consistently checks for updates.
     
    mpchekuri, Mar 24, 2012 IP
  9. ker

    ker Peon

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #9
    Thank You all...
     
    ker, Mar 25, 2012 IP