I'm having an issue with a php include I added to a web page. I have several php includes on this webpage and they are formatted the same exact way. It was working and for some reason it is no longer working now. I'm not sure what happened. I view the source code of the webpage and the code ends just before the php include. I have tried to include the same file in other pages also with no success so I'm guessing the issue must be in the code of the included php file. When I browse to the actual php file it displays properly. When I paste the php code directly into the web page it displays properly. I am racking my brain here. I have spent hours trying to figure out what is wrong and I can't. Please help.
php file displaying properly when browsed to directly: http://www.metrowestpoker.com/includes/api/ChipLeaders.php
the php code in that file:
<?php
$topcount = 20; // display top 10 or use any number you like
include "API.php"; // API $url and $pw values set here
// Fetch the Site Name using the SystemGet API command.
$params = "Password=" . $pw . "&Command=SystemGet&Property=SiteName";
$api = Poker_API($url,$params,true);
$result = $api["Result"];
if ($result == "Error") die("Error: " . $api["Error"]);
$sitename = $api["Value"];
// Fetch the list of players using the AccountsList API command.
$params = "Password=" . $pw . "&Command=AccountsList&Fields=Player,Balance";
$api = Poker_API($url,$params,true);
$result = $api["Result"];
if ($result == "Error") die("Error: " . $api["Error"]);
// Iterate through the players in the response and create a associative
// chips array keyed on player name.
$accounts = $api["Accounts"];
$chips = Array();
for ($i = 1; $i <= $accounts; $i++)
{
$player = $api["Player" . $i];
$chips[$player] = $api["Balance" . $i];
}
// Sort array in decending order.
arsort($chips);
// Display results in an html table.
echo "<table border='1' cellspacing='0' cellpadding='5'>\r\n";
echo "<tr><th colspan='3'>$sitename - Chip Leaders</th></tr>\r\n";
echo "<tr><th>Rank</th><th>Player</th><th>Balance</th></tr>\r\n";
$rank = 0;
foreach ($chips as $p => $c)
{
$rank++;
echo "<tr><td>$rank</td><td>$p</td><td>$c</td></tr>\r\n";
if ($rank == $topcount) break;
}
echo "</table><br>\r\n";
?>
here is the page with the above code pasted directly in (working fine...click on the online leaderboard tab):
http://www.metrowestpoker.com/leaderboard2.php
now here is the page with the above code in file ChipLeaders.php put in the includes/api/ folder (view the source to see the html cuts off where the include should begin):
http://www.metrowestpoker.com/leaderboard.php
here is a code snippet from the above page:
<!--Tab2-->
<div class="TabbedPanelsContent">
<h4 align="center">MWPT Online Hold'em - Monthly Top 20</h4>
<p align="center">
<?php require 'includes/api/ChipLeaders.php'; ?>
</p>
</div>
I feel like I looked over everything but can't figure it out. It's driving me nuts. Please help. Thank you in advance.