Jump to content

Mr.Victor

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Mr.Victor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I changed: include "API.php"; to: include_once "API.php"; in the ChipLeaders.php file and that worked out! Sweeeet! I'm just curious why that did it. There is no other: include "API.php"; anywhere else in the ChipLeaders.php so I'm not sure why it's saying it's calling it twice.
  2. Thanks Rajiv! Making some progress. Here is the error i got: Fatal error: Cannot redeclare poker_api() (previously declared in /services2/webpages/util/m/w/mwpl.site.aplus.net/public/includes/api/API.php:6) in /services2/webpages/util/m/w/mwpl.site.aplus.net/public/includes/api/API.php on line 47
  3. Dreamweaver automatically updates links when the code calls it from the root dir...api.php is definitely in the includes/api/ folder.
  4. like this? <?php error_reporting (E_ALL); require 'includes/api/ChipLeaders.php'; ?> Also, I tried putting the include statement ( in another file and now it displayed like it should but still won't in the original web page. Man this has me so confused.
  5. I tried that earlier. It didn't make a difference but I do appreciate the reply anyhow.
  6. 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.