Detecting when a user leaves a page

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Detecting when a user leaves a page

    Hello,

    I need (I think) to find a way of detecting when a user leaves a web-page;
    by hitting a link or the Back button, by typing into the address window, or
    by closing the browser.

    Here's why:

    I'm writing a system to give a number of users access to documents (stored
    in a mysql database) for shared editing. Most aspects of this have been
    pretty easy, but I'm having trouble with the check-out part of it.

    So far: when a user opens the edit page (doc_id sent in the query string)
    the document is flagged as open in the database and subsequent attempts to
    open it are refused. When the user hits Save, the document is updated and
    the flag reset so the document can be opened. There's a time-out so that
    after a couple of hours or the document is flagged as closed
    irrespectively, on the assumption that they must have given up or got
    bored.

    The problem is that users may not hit the Save button! At the moment any
    movement away from the page except via save means, effectively, that the
    document is locked until the end of the time-out - even from the user who
    opened it, so that, for instance, hitting Refresh is like letting your door
    slam behind you when your key are inside...

    This last, I can cure with a session variable holding the doc-id so that the
    original user will retain access to the document even if they wander away
    in the meantime - or maybe by putting the user's username into another
    database column.

    That's OK for /them/, but if they just leave the page or close their browser
    without hitting Save, and without intending to come back, I can't think of
    any way to detect this and reset the flag so that other users will again
    have access to the document!

    I'm tearing my hair out here: all suggestions very welcome.

    Thanks in advance,
    Ben
    Ben Paley Guest

  2. Similar Questions and Discussions

    1. Detecting user country
      I am creating a page for a shop and there is a UK shop and an International shop. I have created both pages, each page has a link to the other as...
    2. Can I perform a function when user leaves site?
      I need to update a database record when a User closed his browswer or leaves the site. Is this possible? If so, how would I do that?
    3. Capturing event when user leaves a cell?
      Does anyone know what event this might be? In a datagrid, user clicks on Edit on a row, types data in the first cell, then goes to the next cell. ...
    4. #24858 [Opn->Bgs]: proc_open() leaves zombie processes if user cancels page load
      ID: 24858 User updated by: jr-php2 at quo dot to Reported By: jr-php2 at quo dot to -Status: Open +Status: ...
    5. #24858 [NEW]: proc_open() leaves zombie processes if user cancels page load
      From: jr-php2 at quo dot to Operating system: Red Hat Linux 9.0, kernel 2.4.21 PHP version: 4.3.2 PHP Bug Type: Program...
  3. #2

    Default Re: Detecting when a user leaves a page

    Ben Paley <ben@spooty.net> wrote in
    news:XMI2d.1478$c56.398@newsfe5-gui.ntli.net:
    > That's OK for /them/, but if they just leave the page or close their
    > browser without hitting Save, and without intending to come back, I
    > can't think of any way to detect this and reset the flag so that other
    > users will again have access to the document!
    >
    > I'm tearing my hair out here: all suggestions very welcome.
    You won't be able to detect when a user leaves a page, so give up even
    considering that as an option. You can set a time limit for documents,
    however....

    In your documents table, when a file is checked out, record the timestamp.
    When another user wishes open that file, a script can see if the database
    reports the file as checked back in (and therefore give access immediately)
    or if the document is reported as 'out', the script would compare the
    timestamp of the request to the timestamp in the database... if 10 minutes
    (or whatever you choose) has elapsed, let the new user sign out the
    document...

    It's pretty similar to your timeout scheme, but there really aren't a whole
    lot of options as far as I know...



    Good Man Guest

  4. #3

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    > Hello,
    >
    > I need (I think) to find a way of detecting when a user leaves a web-page;
    > by hitting a link or the Back button, by typing into the address window, or
    > by closing the browser.
    Hitting a link is quite easy, just make the links to point at a php page on
    your own site which takes the remote source as the argument, then the page
    does what you want it to do before the user leaves your site and then redirect
    the user to the external page.

    The rest of the methodes will go quite unnoticed by you.

    > The problem is that users may not hit the Save button! At the moment any
    > movement away from the page except via save means, effectively, that the
    > document is locked until the end of the time-out - even from the user who
    > opened it, so that, for instance, hitting Refresh is like letting your door
    > slam behind you when your key are inside...
    You can use a cookie fo the user who opened the edit, set the lifetime for the
    cookie to the same length as the timeout time, then you can make a check for
    the cookie to see if the user is the one who opened the and allow that one to
    edit as long the text is locked (when it's saved the cookie is removed).



    //Aho
    J.O. Aho Guest

  5. #4

    Default Re: Detecting when a user leaves a page

    Good Man wrote:
    > Ben Paley <ben@spooty.net> wrote in
    > news:XMI2d.1478$c56.398@newsfe5-gui.ntli.net:
    >
    >> That's OK for /them/, but if they just leave the page or close their
    >> browser without hitting Save, and without intending to come back, I
    >> can't think of any way to detect this and reset the flag so that other
    >> users will again have access to the document!
    >>
    >> I'm tearing my hair out here: all suggestions very welcome.
    >
    > You won't be able to detect when a user leaves a page, so give up even
    > considering that as an option. You can set a time limit for documents,
    > however....
    >
    > In your documents table, when a file is checked out, record the timestamp.
    > When another user wishes open that file, a script can see if the database
    > reports the file as checked back in (and therefore give access
    > immediately) or if the document is reported as 'out', the script would
    > compare the timestamp of the request to the timestamp in the database...
    > if 10 minutes (or whatever you choose) has elapsed, let the new user sign
    > out the document...
    This is exactly what I did, in fact - I didn't go into details because I
    hoped it wasn't relevant!

    This is problematic, though: set the time limit too low and other people
    will be able to open the document before an earlier user has finished. Set
    it too high and people are locked out for ages... the point of balance will
    be when I get both problems equally, I fear, rather than neither.

    What do you think about using a javascript onUnload() to call a php script?
    I can think of any number of objections to this, but is it even
    theoretically do-able? Perhaps I should just start playing (but I smell a
    dead-end...)

    Well, thanks a lot for your help even if it's more negative than positive -
    perhaps you have just saved me hours or days of fruitless key-bashing.

    Cheers,
    Ben
    Ben Paley Guest

  6. #5

    Default Re: Detecting when a user leaves a page

    J.O. Aho wrote:
    > Ben Paley wrote:
    >> Hello,
    >>
    >> I need (I think) to find a way of detecting when a user leaves a
    >> web-page; by hitting a link or the Back button, by typing into the
    >> address window, or by closing the browser.
    >
    > Hitting a link is quite easy, just make the links to point at a php page
    > on your own site which takes the remote source as the argument, then the
    > page does what you want it to do before the user leaves your site and then
    > redirect the user to the external page.
    >
    > The rest of the methodes will go quite unnoticed by you.
    >
    >
    >> The problem is that users may not hit the Save button! At the moment any
    >> movement away from the page except via save means, effectively, that the
    >> document is locked until the end of the time-out - even from the user who
    >> opened it, so that, for instance, hitting Refresh is like letting your
    >> door slam behind you when your key are inside...
    >
    > You can use a cookie fo the user who opened the edit, set the lifetime for
    > the cookie to the same length as the timeout time, then you can make a
    > check for the cookie to see if the user is the one who opened the and
    > allow that one to edit as long the text is locked (when it's saved the
    > cookie is removed).
    Thanks a lot for your help. It begins to look as though my central problem
    is simply not sortable, so I'll have to kludge round it.

    BTW, some googling seemed to show that this would be quite easy in asp,
    where there's an event handler for a session finishing!

    Cheers,
    Ben
    Ben Paley Guest

  7. #6

    Default Re: Detecting when a user leaves a page


    "Ben Paley" <ben@spooty.net> wrote in message
    news:XMI2d.1478$c56.398@newsfe5-gui.ntli.net...
    > Hello,
    >
    > I need (I think) to find a way of detecting when a user leaves a web-page;
    > by hitting a link or the Back button, by typing into the address window,
    or
    > by closing the browser.
    >
    > Here's why:
    >
    > I'm writing a system to give a number of users access to documents (stored
    > in a mysql database) for shared editing. Most aspects of this have been
    > pretty easy, but I'm having trouble with the check-out part of it.
    >
    > So far: when a user opens the edit page (doc_id sent in the query string)
    > the document is flagged as open in the database and subsequent attempts to
    > open it are refused. When the user hits Save, the document is updated and
    > the flag reset so the document can be opened. There's a time-out so that
    > after a couple of hours or the document is flagged as closed
    > irrespectively, on the assumption that they must have given up or got
    > bored.
    >
    > The problem is that users may not hit the Save button! At the moment any
    > movement away from the page except via save means, effectively, that the
    > document is locked until the end of the time-out - even from the user who
    > opened it, so that, for instance, hitting Refresh is like letting your
    door
    > slam behind you when your key are inside...
    >
    > This last, I can cure with a session variable holding the doc-id so that
    the
    > original user will retain access to the document even if they wander away
    > in the meantime - or maybe by putting the user's username into another
    > database column.
    >
    > That's OK for /them/, but if they just leave the page or close their
    browser
    > without hitting Save, and without intending to come back, I can't think of
    > any way to detect this and reset the flag so that other users will again
    > have access to the document!
    >
    > I'm tearing my hair out here: all suggestions very welcome.
    >
    > Thanks in advance,
    > Ben
    This is off the top of my head...

    Lock the record at the database level.

    I think it is possible to set a time out on a locked record/table.

    Unlock after update.

    If they move away from the page their connection to the db is closed and
    locks are reset ie. unlocked.

    Plus you don't have to bother with the flag.

    Not sure how you'd let other users know the record was locked...

    HTH
    RUPE


    Rupe Guest

  8. #7

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    > Hello,
    >
    > I need (I think) to find a way of detecting when a user leaves a web-page;
    > by hitting a link or the Back button, by typing into the address window,
    > or by closing the browser.
    Or how about this:

    Is there any way to determine whether a given session id (not necessarily
    the current session) is valid? If so, we could store the opening user's
    session id in the database, then check to see (in effect) if their browser
    is still open when someone else finds the document flagged open.

    The documentation look unpromising on this point, but I thought it might be
    worth asking.

    Cheers,
    Ben
    Ben Paley Guest

  9. #8

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    > Thanks a lot for your help. It begins to look as though my central problem
    > is simply not sortable, so I'll have to kludge round it.
    The problem starts from the point where HTTP is not a session based
    protocol. What you are trying to do is replicate a true session and there
    are obvious limitations. You should try the suggestions (including some of
    yours) since there is no way to make real sessions with HTTP. Here's a
    short summary:

    - Javascript onunload event should help, but will not guarantee
    - "locking" a document with server timestamp and "freeing" after time
    allotted has passed (when not saved)
    - presenting the editing user with a Javascript dialog every 10-15 minutes
    (or whatever time period) to make sure they are still there
    > BTW, some googling seemed to show that this would be quite easy in asp,
    > where there's an event handler for a session finishing!
    ASP doesn't magically create true sessions over HTTP. It relies on the same
    methods to track sessions and does not help in your case when:

    - scripting is turned off
    - browser crashes
    - OS crashes
    - client disconnects from the internet/network
    - etc.

    This list would be the same with whatever you can implement in PHP or Perl
    or whatever else over HTTP.
    Zurab Davitiani Guest

  10. #9

    Default Re: Detecting when a user leaves a page

    SMJ wrote:
    > <alt.php , Ben Paley , [email]ben@spooty.net[/email]>
    > <XMI2d.1478$c56.398@newsfe5-gui.ntli.net>
    > <Fri, 17 Sep 2004 21:35:51 GMT>
    >
    >> That's OK for /them/, but if they just leave the page or close their
    >> browser without hitting Save, and without intending to come back, I can't
    >> think of any way to detect this and reset the flag so that other users
    >> will again have access to the document!
    >>
    >> I'm tearing my hair out here: all suggestions very welcome.
    >>
    >
    > In theory as i'm only at beginner level .
    >
    > A timed alert box every 5-10 minutes asking them to save the document -
    > if no answer - they have gone .
    Not bad - but if they'd gone the alert box wouldn't happen, would it?
    Ben Paley Guest

  11. #10

    Default Re: Detecting when a user leaves a page

    Rupe wrote:
    > This is off the top of my head...
    >
    > Lock the record at the database level.
    >
    > I think it is possible to set a time out on a locked record/table.
    >
    > Unlock after update.
    >
    > If they move away from the page their connection to the db is closed and
    > locks are reset ie. unlocked.
    This sounds promising. I'll have to go back to the mysql docs and check it
    out.
    >
    > Plus you don't have to bother with the flag.
    >
    > Not sure how you'd let other users know the record was locked...
    Well, they wouldn't be able to see the record... hmm... but you're right,
    they'd need to see it to know it was there, and the way things work at the
    moment, depending on how the lock works, if they couldn't see it they'd
    probably be given a previous version of the document, which would be no
    improvement at all!

    Well, I'll be poring over the mysql manual tonight.

    Thanks very much for your suggestion.

    Cheers,
    Ben
    Ben Paley Guest

  12. #11

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    >> If they move away from the page their connection to the db is closed and
    >> locks are reset ie. unlocked.
    >
    > This sounds promising. I'll have to go back to the mysql docs and check it
    > out.
    This doesn't make sense - there is no direct database connection from a
    client to the DB server - therefore, when the client moves away from your
    page, it doesn't affect any database connection!
    > Well, I'll be poring over the mysql manual tonight.
    Unless you want to implement some client-side distributed COM object ActiveX
    control - which, I assume, is not what you mean.
    Zurab Davitiani Guest

  13. #12

    Default Re: Detecting when a user leaves a page

    Zurab Davitiani wrote:
    > The problem starts from the point where HTTP is not a session based
    > protocol. What you are trying to do is replicate a true session and there
    > are obvious limitations. You should try the suggestions (including some of
    > yours) since there is no way to make real sessions with HTTP. Here's a
    > short summary:
    >
    > - Javascript onunload event should help, but will not guarantee
    > - "locking" a document with server timestamp and "freeing" after time
    > allotted has passed (when not saved)
    > - presenting the editing user with a Javascript dialog every 10-15 minutes
    > (or whatever time period) to make sure they are still there
    >
    >> BTW, some googling seemed to show that this would be quite easy in asp,
    >> where there's an event handler for a session finishing!
    >
    > ASP doesn't magically create true sessions over HTTP. It relies on the
    > same methods to track sessions and does not help in your case when:
    >
    > - scripting is turned off
    > - browser crashes
    > - OS crashes
    > - client disconnects from the internet/network
    > - etc.
    >
    > This list would be the same with whatever you can implement in PHP or Perl
    > or whatever else over HTTP.
    Of course! I sometimes feel like half my time is spent getting around the
    stateless nature of the web.

    Thanks a lot for your systematic presentation of my options so far, I
    appreciate your advice.

    Cheers,
    Ben
    Ben Paley Guest

  14. #13

    Default Re: Detecting when a user leaves a page

    Zurab Davitiani wrote:
    > Ben Paley wrote:
    >
    >>> If they move away from the page their connection to the db is closed and
    >>> locks are reset ie. unlocked.
    >>
    >> This sounds promising. I'll have to go back to the mysql docs and check
    >> it out.
    >
    > This doesn't make sense - there is no direct database connection from a
    > client to the DB server - therefore, when the client moves away from your
    > page, it doesn't affect any database connection!
    >
    >> Well, I'll be poring over the mysql manual tonight.
    >
    > Unless you want to implement some client-side distributed COM object
    > ActiveX control - which, I assume, is not what you mean.
    Replying to myself here, but I forgot to add that you have an option of
    something similar implemented in Java applet where the applet itself makes
    connections to the database server - you can have your sessions then. Of
    course, be aware of how many simultaneous DB connections you may have.
    Zurab Davitiani Guest

  15. #14

    Default Re: Detecting when a user leaves a page

    Zurab Davitiani wrote:
    > Ben Paley wrote:
    >
    >>> If they move away from the page their connection to the db is closed and
    >>> locks are reset ie. unlocked.
    >>
    >> This sounds promising. I'll have to go back to the mysql docs and check
    >> it out.
    >
    > This doesn't make sense - there is no direct database connection from a
    > client to the DB server - therefore, when the client moves away from your
    > page, it doesn't affect any database connection!
    Oh.

    Well, that's that, then.
    > Unless you want to implement some client-side distributed COM object
    > ActiveX control - which, I assume, is not what you mean.
    You assume correctly.

    Thanks again. If anything magically occurs to you, let me know, won't you?

    Cheers,
    Ben
    Ben Paley Guest

  16. #15

    Default Re: Detecting when a user leaves a page

    Zurab Davitiani wrote:
    >>
    >> Unless you want to implement some client-side distributed COM object
    >> ActiveX control - which, I assume, is not what you mean.
    >
    > Replying to myself here, but I forgot to add that you have an option of
    > something similar implemented in Java applet where the applet itself makes
    > connections to the database server - you can have your sessions then. Of
    > course, be aware of how many simultaneous DB connections you may have.
    That sounds like a great idea, if I had any idea how to go about doing it -
    I guess I probably won't have learnt by the beginning of next week, either.

    But I think I'm learning something just from the sort of things you're
    thinking of.

    Thanks again,
    Ben
    Ben Paley Guest

  17. #16

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    > Hello,
    >
    > I need (I think) to find a way of detecting when a user leaves a web-page;
    > by hitting a link or the Back button, by typing into the address window,
    > or by closing the browser.
    >
    > Here's why:
    >
    > I'm writing a system to give a number of users access to documents (stored
    > in a mysql database) for shared editing. Most aspects of this have been
    > pretty easy, but I'm having trouble with the check-out part of it.
    >
    > So far: when a user opens the edit page (doc_id sent in the query string)
    > the document is flagged as open in the database and subsequent attempts to
    > open it are refused. When the user hits Save, the document is updated and
    > the flag reset so the document can be opened. There's a time-out so that
    > after a couple of hours or the document is flagged as closed
    > irrespectively, on the assumption that they must have given up or got
    > bored.
    >
    > The problem is that users may not hit the Save button! At the moment any
    > movement away from the page except via save means, effectively, that the
    > document is locked until the end of the time-out - even from the user who
    > opened it, so that, for instance, hitting Refresh is like letting your
    > door slam behind you when your key are inside...
    >
    > This last, I can cure with a session variable holding the doc-id so that
    > the original user will retain access to the document even if they wander
    > away in the meantime - or maybe by putting the user's username into
    > another database column.
    >
    > That's OK for /them/, but if they just leave the page or close their
    > browser without hitting Save, and without intending to come back, I can't
    > think of any way to detect this and reset the flag so that other users
    > will again have access to the document!
    >
    > I'm tearing my hair out here: all suggestions very welcome.
    >
    > Thanks in advance,
    > Ben

    The only solution I could think of would involve a little JavaScript. There
    is no way for PHP to access the state of the users's browser 'cause it's a
    server side language, JavaScript is client side. So a combination would do
    the trick.

    zeitgeist
    zeitgeist Guest

  18. #17

    Default Re: Detecting when a user leaves a page

    zeitgeist wrote:
    > Ben Paley wrote:
    >
    >> Hello,
    >>
    >> I need (I think) to find a way of detecting when a user leaves a
    >> web-page; by hitting a link or the Back button, by typing into the
    >> address window, or by closing the browser.
    >
    > The only solution I could think of would involve a little JavaScript.
    > There is no way for PHP to access the state of the users's browser 'cause
    > it's a server side language, JavaScript is client side. So a combination
    > would do the trick.
    I think you're right, unfortunately - good job the target audience is
    unlikely to be using Lynx.

    Cheers,
    Ben
    Ben Paley Guest

  19. #18

    Default Re: Detecting when a user leaves a page

    Ben Paley wrote:
    >
    > That's OK for them, but if they just leave the page or close their browser
    > without hitting Save, and without intending to come back, I can't think of
    > any way to detect this and reset the flag so that other users will again
    > have access to the document!
    >
    You can't detect it. What you need to do is keep a table in your database with
    user-1's ID, the doc ID and the time it was requested by user-1. When user-2
    comes along and wants the doc, check the table, see if it is in use by anyone
    and if so has it been more than X minutes? If so, let user-2 have it and
    assume user-1 has left the room. Otherwise, tell user-2 to try again in X
    minutes. Of course, you also should put in some logic such that if user-1
    goes somewhere else in the application, you clear his entry in the table.
    This can get messy when user-1 opens a second window to see another part of
    your application and you clear his table entry. Make sure you tell all users
    that there is an X-minute limit for using a doc... and not to open multiple
    windows. . Finally, make sure you check the table before you do any updates
    by user-1 to make sure he still has ownership.

    The above is a server-side "solution." There may be a better client-side
    solution via Javascript but I don't know much Javascript. We don't use it
    because it chokes a lot of browsers.

    Al C.
    __________________________________________________ ________
    Adams-Blake Company, Inc.
    ***
    JAYA123 - the web-based total-office system for the
    small biz. Order entry, billing, bookkeeping, etc. for $14.95
    a month. Perfect for the small business or start-up.
    See demo at: [url]http://www.jaya123.com[/url]
    ***


    Al C. Guest

  20. #19

    Default Re: Detecting when a user leaves a page


    "Zurab Davitiani" <agt@mindless.com> wrote in message
    news:EpK2d.22316$i%1.18116@newssvr29.news.prodigy. com...
    > Ben Paley wrote:
    >
    > >> If they move away from the page their connection to the db is closed
    and
    > >> locks are reset ie. unlocked.
    > >
    > > This sounds promising. I'll have to go back to the mysql docs and check
    it
    > > out.
    >
    > This doesn't make sense - there is no direct database connection from a
    > client to the DB server - therefore, when the client moves away from your
    > page, it doesn't affect any database connection!
    >
    > > Well, I'll be poring over the mysql manual tonight.
    >
    > Unless you want to implement some client-side distributed COM object
    ActiveX
    > control - which, I assume, is not what you mean.
    Of course that's what I meant!! not really. I did say off the top...

    R


    Rupe Guest

  21. #20

    Default Re: Detecting when a user leaves a page


    "Ben Paley" <ben@spooty.net> wrote in message
    news:XMI2d.1478$c56.398@newsfe5-gui.ntli.net...
    > Hello,
    >
    > I need (I think) to find a way of detecting when a user leaves a web-page;
    > by hitting a link or the Back button, by typing into the address window,
    or
    > by closing the browser.
    >
    > Here's why:
    >
    > I'm writing a system to give a number of users access to documents (stored
    > in a mysql database) for shared editing. Most aspects of this have been
    > pretty easy, but I'm having trouble with the check-out part of it.
    >
    > So far: when a user opens the edit page (doc_id sent in the query string)
    > the document is flagged as open in the database and subsequent attempts to
    > open it are refused. When the user hits Save, the document is updated and
    > the flag reset so the document can be opened. There's a time-out so that
    > after a couple of hours or the document is flagged as closed
    > irrespectively, on the assumption that they must have given up or got
    > bored.
    >
    > The problem is that users may not hit the Save button! At the moment any
    > movement away from the page except via save means, effectively, that the
    > document is locked until the end of the time-out - even from the user who
    > opened it, so that, for instance, hitting Refresh is like letting your
    door
    > slam behind you when your key are inside...
    >
    > This last, I can cure with a session variable holding the doc-id so that
    the
    > original user will retain access to the document even if they wander away
    > in the meantime - or maybe by putting the user's username into another
    > database column.
    >
    > That's OK for /them/, but if they just leave the page or close their
    browser
    > without hitting Save, and without intending to come back, I can't think of
    > any way to detect this and reset the flag so that other users will again
    > have access to the document!
    >
    > I'm tearing my hair out here: all suggestions very welcome.
    >
    > Thanks in advance,
    > Ben
    Your best bet is find it on goooooooooooogle:

    [url]http://php.resourceindex.com/Complete_Scripts/[/url]

    is a start...

    Rupe


    Rupe Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139