Page loading driving me crazy!

Discussion in 'PHP' started by deleted-account, Jun 21, 2009.

  1. #1
    At first my pages were fine, they would finish loading and the little loading image in my browser would stop.

    I then made some changes to the code and now it just goes forever. It said it was loading the google ads so I removed them, no luck. I undid all the script edits again no luck. Then I rewrote the WHOLE script and still no luck. This is driving me insane.

    I know it's not my host because static pages load fine, I'm almost certain it has to do with this one file because it's the only similarity between the pages and the only page all others connect to.

    <?php
    #////--[Included Files]--///////////////////////////////////////////////////////////////////////////////////////////////////////////#
    include('ads.php');
    
    
    #////--[MySQL Connect]--////////////////////////////////////////////////////////////////////////////////////////////////////////////#
    $con = mysql_connect("Removed for obvious reasons")
    
    if (!$con)
    {
    	die('(!) Error: Could not connect: ' .  mysql_error());
    }
    
    mysql_select_db("Removed");
    
    
    #////--[Strings]--//////////////////////////////////////////////////////////////////////////////////////////////////////////////////#
    $mysqlGameSql = "SELECT * FROM game ORDER BY id ASC";
    $mysqlGameResult = mysql_query($mysqlGameSql) or die(mysql_error());
    $mysqlPostSql = "SELECT * FROM posts ORDER BY id DESC";
    $mysqlPostResult = mysql_query($mysqlPostSql) or die(mysql_error());
    $textUrl['gears'] = "Removed";
    $textUrl['site'] = "Removed";
    $textUrl['games'] = "Removed";
    $textUrl['posts'] = "Removed";
    
    
    #////--[Functions]--////////////////////////////////////////////////////////////////////////////////////////////////////////////////#
    function designOpen($title)
    {
    	global $textUrl;
    	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', "\n";
    	echo '<html xmlns="http://www.w3.org/1999/xhtml">', "\n";
    	echo '<head>', "\n";
    	echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />', "\n";
    	echo '<meta name="verify-v1" content="Removed" />', "\n";
    	echo '<title>Removed - ', $title, '</title>', "\n";
    	echo '<link rel="stylesheet" type="text/css" href="styles.css" />', "\n";
    	echo '</head>', "\n";
    	echo '<body>', "\n";
    	echo '<div class="mainContainer" align="center">', "\n";
    	echo '<div class="topNaviContainer">', "\n";
    	echo '<div class="contents">', "\n";
    	echo '<a href="', $textUrl['site'], '/">Home</a>', "\n", '<a href="', $textUrl['site'], '/games.php">Games</a>', "\n", '<a href="', $textUrl['site'], '/posts.php">Posts</a>', "\n";
    	echo '</div>', "\n";
    	echo '</div>', "\n";
    	echo '<div class="bodyContainer">', "\n";
    	echo '<div class="leaderboard"></div>', "\n";
    	echo '<div class="leader-ads">'; displayAds(); echo '</div>', "\n";
    	echo '<div class="columnContainer" align="right">', "\n";
    	# Function closes and is displayed in all pages using the theme
    }
    
    function leftColumn($page)
    {
    	global $textUrl;
    	echo '<div class="leftColumn">', "\n";
    	echo '<ul>', "\n";
    	echo '<li>Navigation</li>', "\n";
    	echo '<li><a href="', $textUrl['site'], '/">Homepage</a></li>', "\n";
    	echo '<li><a href="', $textUrl['site'], '/posts.php">View posts</a></li>', "\n";
    	echo '<li><a href="', $textUrl['site'], '/games.php">View games</a></li>', "\n";
    	echo '</ul>', "\n";
    	echo '<script type="text/javascript">Removed</script>', "\n";
    	echo '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>', "\n";
    	echo '</div>', "\n";
    }
    
    function designClose()
    {
    	echo '<div class="leader-ads">'; displayAds(); echo '</div>', "\n";
    	echo '<div class="copyright">', "\n";
    	echo '<a href="Removed" target="_blank"><img src="images/mt-logo.png" alt="(mt) MediaTemple" border="0" align="right" /></a>', "\n";
    	echo 'Original content and design copyright &copy; 2009. All rights reserved.<br/>All other content is property of his/her respective owner.<br/>Lozwii.com takes no responsibility for content on sites linking to and from this site.', "\n";
    	echo '</div>', "\n";
    	echo '</div>', "\n";
    	echo '</div>', "\n";
    	echo '</body>', "\n";
    	echo '</html>', "\n";
    }
    
    function displayMonth($num)
    {
    	switch($num)
    	{
    	  case '1': $month = 'January'; break;
    	  case '2': $month = 'February'; break;
    	  case '3': $month = 'March'; break;
    	  case '4': $month = 'April'; break;
    	  case '5': $month = 'May'; break;
    	  case '6': $month = 'June'; break;
    	  case '7': $month = 'July'; break;
    	  case '8': $month = 'August'; break;
    	  case '9': $month = 'September'; break;
    	  case '10': $month = 'October'; break;
    	  case '11': $month = 'November'; break;
    	  case '12': $month = 'December'; break;
    	  default: echo "error"; break;
    	}
    	echo $month;
    }
    
    #////--[End]--//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#
    ?>
    Code (php):
    Please help!
     
    deleted-account, Jun 21, 2009 IP
  2. Louis11

    Louis11 Active Member

    Messages:
    783
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #2
    I was going to say to throw in a bunch of echo/print's but it looks like you have enough of those already :) I quickly glanced at the script and don't see anything that I would consider a potential candidate for an infinite loop. Have you checked in the included file ads.php? Perhaps you can comment out the include temporarily and see what happens.
     
    Louis11, Jun 21, 2009 IP
  3. deleted-account

    deleted-account Active Member

    Messages:
    655
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    85
    #3
    Yeah I removed some things and now it seems to load fine. I never figured out what the problem was :-/. Oh well as long as it is solved.
     
    deleted-account, Jun 21, 2009 IP
  4. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #4
    Using echo or print is archaic, does ANYONE use a debugger?
     
    Social.Network, Jun 21, 2009 IP