SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Sep 2005
    Posts
    271
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Something is causing the page to load twice

    On my site, a user is telling me they keep getting errors and are managing to duplicate items (for the game). All the things they are describing to me is that whenever they load a page, it seems to be double loading.

    I'm not sure if it is a coincindence, but it also seems like it happens whenever there is a form button that needs clicking.

    Anyway, I tried to recreate the error; I downloaded the same browser, use the same OS, tried putting all the same settings they had and still no luck. I cannot seem to recreate the error.

    The site runs in PHP, so i'm not sure what is causing the pages to execute the code twice?

    Is there any methods to make sure the user only executes the page once ;/? Its only one user who has this problem but I am determined to figure out what could be the cause of it.

    I've heard that having empty img src values can cause the page to double load, but would this be noticeable? And how could it be that it only happens to one user :X

    Sorry if this is in the wrong section, but I figured it might have something to do with PHP, or at least there is some PHP methods I could use in order to help avoid the error or find out what is causing it.

    Thanks to any who have information Y_Y

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It could be his cache settings -- the browser has to make an HTTP HEAD request to the page to get the etag/last modified time to determine if it should serve the page from cache, or make a second GET request for the contents of the page.

    Easy way to check is to just look at your access log. Search for this guy's IP and look for duplicate HTTP requests. If they're there, then yeah, his browser is making two requests.

  3. #3
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a common problem especially, if you use templates. Be sure to add exit after you output your template:

    PHP Code:
    echo $template->get_html();
    exit(); 

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you can identify this user programatically, for example by ip address or the browser user agent string, you can do some logging to help you identify the problem. For example, you can log the http requests sent to your server from them, and log the html output. You just might see your problem, which I'm guessing is probably invalid html being generated.

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Location
    Ljubljana, Slovenia
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DoubleClick?
    Gregor Grajzar, web developer
    http://xweblabs.com
    http://grajzar.info

  6. #6
    SitePoint Addict
    Join Date
    Sep 2005
    Posts
    271
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Okay I set up some logging to log the users every move, including page url, http methods, connection and all that stuff. I asked my host to check the http logs for the users IP but they told me they need the user to view a few more pages (I assume there are too many logs or w/e). Anyways, still trying to figure out the problem but no luck ;X


Bookmarks

Posting Permissions

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