?
Solved

Web Page not fully loading

Posted on 2010-01-04
13
Medium Priority
?
511 Views
Last Modified: 2012-08-13
I have a website www.slavetothebeat.co.uk. I have recently noticed that certain pages don't seem to load fully on their first load. If you click on drum kits and select the first product, this normally happens. You can of course refresh the page and it loads it fully. I've tried this in IE and Firefox, it's not 100% of the time but it happens quite a lot. It can also be seen when a product is added into the cart, the cart page doesn't display fully.

Any ideas?

Many thanks

Chris

0
Comment
Question by:djfenom
  • 6
  • 4
  • 3
13 Comments
 
LVL 7

Expert Comment

by:marklogan
ID: 26169874
It has loaded fine for me.

Have you check any error logs?

You might have a script timeout issue, does it always take a long time to load when it stops halfway?

If you have a PHP set to timeout after 10 seconds, the script will stop running and nothing else will be loaded.
0
 

Author Comment

by:djfenom
ID: 26169983
It's strange, it seems ok for me now even after emptying my cache. My client brought the issue to light after several of his customers complained about the same problem.

I've checked the error log and there is nothing in there untoward.

How do I change the PHP timeout? I've got other sites of this size and have never had issues with them?
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 26170025
You have links to external sites such as Ebay, Facebook and Google Analytics. Chances are that a script or link is waiting for one of these external items to load. I have seen this happen with Google Analytics where the javascript stalls while waiting for a response from Analytics when it is presumably very busy, but this behaviour can happen to any external data source. Advert servers are particularly prone to stalling.

In Firefox (not sure about IE) there is usually a status in the bottom left corner that says something like "Loading http://example.com/someScript" and that is usually the giveaway.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:djfenom
ID: 26170084
It's just done it again for me in Firefox and there is no loading status in the left corner, it just says done.

Attached is the source that is loaded:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Session Pro DD505 Electric Drum Kits | Electronic Drum Kits</title>
<meta name="keywords" content="Electronic Drum Kits, Session Pro electric Drum kits, Session Pro, Session Pro dd505, Electric Kits, Electric Drums, Electric Drum Kits, Roland Electric Drums, Yamaha Electric Drum Kits, " />
<meta name="description" content="Electric Drum Kits from &pound;300 available in a selection of colours. Slave to the beat is an online dedicated Drum Retailer of acoustic and electric drum kits." />
<link rel="stylesheet" type="text/css" href="/css/jquery.jcarousel.css" />
<link rel="stylesheet" type="text/css" href="/css/skin.css" />
<link href="/css/slave.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="/css/iestyles.css" />
<![endif]-->
<link href="/css/lightbox.css" rel="stylesheet" type="text/css" />
<link href="/css/cart.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/nopercart.js"></script>
<script type="text/javascript" src="/js/jquery-1.2.2.pack.js"></script>

<script type="text/javascript" src="/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="/js/lightbox.js"></script><script type="text/javascript" src="/js/jquery.jcarousel.pack.js"></script>
<script type="text/javascript">
function mycarousel_initCallback(carousel,eId) {
 
    jQuery( eId + ' > .numbers a').bind('click', function() {
 
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
    return false;
};
 
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: function(c){mycarousel_initCallback(c,'.mycarousel');}
    });
 
});
</script>
</head>
<body id="products">
<div id="container">
  <div id="top">
  <h1><a href="/"><img src="/images/logo.gif" alt="Slave to the Beat Drum Kits UK" /></a><span class="hide">Slave to the Beat Drum Kits UK</span></h1>
  <div id="cart_buttons">

    <p class="cart_display">
  <script type="text/javascript">
<!--
   if ( Cart_is_empty()) {
      document.write('<span class="cart_items">No items in Cart</span> <span class="cart_total">&pound;0.00</span>');
   } else {
      document.write('<span class="cart_items"><a href="/store/basket/">');
      Print_total_products(true);
      document.write(' in cart</a></span> '); 
      document.write('<span class="cart_total">&pound;');
      Print_total(true);
      document.write('</span>');
   }
// -->
  </script>
  </p>
    <p class="cart_links"><a href="/store/basket/">View Cart</a> | <a href="/store/register/">Checkout</a></p>
  </div>
  <div class="cleaner"></div>

  <ul id="nav">
    <li class="homebutt"><a href="/">Home</a></li>
    <li class="aboutbutt"><a href="/about/">About Us</a></li>
    <li class="servbutt"><a href="/services/">Services</a></li>
    <li class="termsbutt"><a href="/terms_conditions/">Terms &amp; Conditions</a></li>
    <li class="faqsbutt"><a href="http://slavetothebeatdrums.wordpress.com" target="_blank">Blog</a></li>

    <li class="contbutt"><a href="/contact/">Contact Us</a></li>
  </ul>
</div>
  <div id="content">
    
<div id="left">
  <div id="searchbar">
    <form id="searchform" method="post" action="/search/" class="searchbox">
      <input name="search" type="text" id="search" class="searchbutt" value="Search..." onclick="this.value=''" />
      <input type="image" src="/images/go-button.gif" name="submit" class="submitbutt" />

    </form>
  </div>
  <h4>Categories:</h4>
  <ul id="categories">

Open in new window

0
 
LVL 7

Accepted Solution

by:
marklogan earned 1000 total points
ID: 26170178
So it has stopped before it really even began generating the page.

The code below extends the timeout to 30 seconds.

http://php.net/manual/en/function.set-time-limit.php


When is the connection to the database opened? As it will need to query the database to generate the categories list. Are you sure it isn't throwing an error here? I might not even be setup to log.

http://php.net/manual/en/function.error-reporting.php
<?php
set_time_limit(30);
?>

Open in new window

0
 

Author Comment

by:djfenom
ID: 26170234
I'll give that a try, thanks.

The connection is opened at the top of the page, there are no errors picked up here:
<?php session_start(); ?>
<?php virtual('/Connections/slave.php'); ?>
<?php
$colname_RSprod = "-1";
if (isset($_GET['id'])) {
  $colname_RSprod = $_GET['id'];
}
mysql_select_db($database_slave, $slave);
$query_RSprod = "SELECT slave_prods.*, slave_cat.*\n"
    . "FROM (slave_prods LEFT JOIN slave_cat ON slave_prods.productCategory = slave_cat.categoryID) WHERE slave_prods.productID = " . $_GET['id'];
$RSprod = mysql_query($query_RSprod, $slave) or die(mysql_error());
$row_RSprod = mysql_fetch_assoc($RSprod);
$totalRows_RSprod = mysql_num_rows($RSprod);

mysql_select_db($database_slave, $slave);
$query_RScathead = "SELECT * FROM slave_cat WHERE categoryID = " . $_GET['cat'];
$RScathead = mysql_query($query_RScathead, $slave) or die(mysql_error());
$row_RScathead = mysql_fetch_assoc($RScathead);
$totalRows_RScathead = mysql_num_rows($RScathead);

if (!empty($row_RSprod['productRelated1'])) {
mysql_select_db($database_slave, $slave);
$query_RSrelated1 = "SELECT * FROM slave_prods WHERE productID = " . $row_RSprod['productRelated1'];
$RSrelated1 = mysql_query($query_RSrelated1, $slave) or die(mysql_error());
$row_RSrelated1 = mysql_fetch_assoc($RSrelated1);
$totalRows_RSrelated1 = mysql_num_rows($RSrelated1);
mysql_select_db($database_slave, $slave);
}

if (!empty($row_RSprod['productRelated2'])) {
$query_RSrelated2 = "SELECT * FROM slave_prods WHERE productID = " . $row_RSprod['productRelated2'];
$RSrelated2 = mysql_query($query_RSrelated2, $slave) or die(mysql_error());
$row_RSrelated2 = mysql_fetch_assoc($RSrelated2);
$totalRows_RSrelated2 = mysql_num_rows($RSrelated2);
mysql_select_db($database_slave, $slave);
}

if (!empty($row_RSprod['productRelated3'])) {
$query_RSrelated3 = "SELECT * FROM slave_prods WHERE productID = " . $row_RSprod['productRelated3'];
$RSrelated3 = mysql_query($query_RSrelated3, $slave) or die(mysql_error());
$row_RSrelated3 = mysql_fetch_assoc($RSrelated3);
$totalRows_RSrelated3 = mysql_num_rows($RSrelated3);
}
?>

Open in new window

0
 

Author Comment

by:djfenom
ID: 26170406
Hmmm, I've put the limit code in and I'm still getting it?

The strange thing is it seems to stop where the category links should start, but the connection to the db must be working as the title of the page is generated by the db and that is displayed.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 26170414
Are you using virtual for a specific Apache related issue, or just to include scripts? In general, don't use virtual, use Require

virtual('/Connections/slave.php');

require_once './Connections/slave.php';

Virtual starts Apache sub processes and is known to cause problems if Caching is used

http://uk2.php.net/virtual

The big difference is Virtual uses paths relative to the webroot whereas Require and Include use paths relative to the current folder.

0
 

Author Comment

by:djfenom
ID: 26170503
Just using it for includes. I tried including your way, but low and behold it still does it!
0
 
LVL 7

Expert Comment

by:marklogan
ID: 26170556
In your code, what are the next few lines directly underneath to code that prints out.


</form>
  </div>
  <h4>Categories:</h4>
  <ul id="categories">

Open in new window

0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 26170652
Just out of interest I ran the page through the W3C validator and it really does not like line 174, in particular  there is an & there rather than an &amp;

(part of line 174)

<a href="/store/detail/?id=148&cat=1">

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.slavetothebeat.co.uk%2F&charset=%28detect+automatically%29&doctype=Inline&ss=1&group=0&verbose=1&user-agent=W3C_Validator%2F1.654


I doubt very much that it could be the cause, but if you can fix it then do so and see. I should add that in FF the website has not yet stalled for me so I'm wondering if this is a browser problem. Are you using IE for viewing the site?

0
 

Author Comment

by:djfenom
ID: 26170920
I've just noticed I have an include file at the top of the page, virtual('/Connections/slave.php') and then I have an include file virtual('/nav.php') further down the page, but within nav.php I had the same virtual('/Connections/slave.php') include again, would this affect things?
0
 
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 1000 total points
ID: 26171062
It might explain why your page loads twice in Firefox. I noticed that the progress bar got 3/4 complete and then went back to zero. Try changing all the "virtual"s to "include_once" and remember that include_once will need a relative path (starts with a './') compared to virtual's webroot "/".

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question