I am layman in the subject and would like some help, I'll spend my ip and password,
so that someone can help me complete the example below.
Thanks!
if possible send e-mail: [email protected]
http://187.44.16.178:8087/
password: 123456
<html>
<body>
<?php
include "API.php"; // $url, $pw, and Poker_API() defined here
if (isset($_REQUEST["submit"])) // page loaded via submit button
{
// split out date and tourney name from selected value
$tourney = stripslashes($_REQUEST["tourney"]);
$trdate = Substr($tourney,0,10);
$trname = Substr($tourney,12);
// retrieve file
$params = "Password=" . $pw . "&Command=TournamentsResults&Date=" . $trdate . "&Name=" . urlencode($trname);
$api = Poker_API($url,$params,false);
// check for error
if ($api[0] == "Result=Error") die($api[1]);
// display results
echo "<pre>\n";
for ($i=1; $i<count($api); $i++) echo $api[$i] . "\n";
echo "</pre>\n";
}
else // initial page load
{
// retrieve list of files
$params = "Password=" . $pw . "&Command=TournamentsResults";
$api = Poker_API($url,$params,true);
// check for error
if ($api["Result"] == "Error") die($api["Error"]);
// fill droplist with dates and tourney names
$count = $api["Files"];
echo "<h3>Tournament Results</h3>\n";
echo "<form method='post'>\n";
echo "<select name='tourney'>\n";
for ($i=1; $i<=$count; $i++)
{
$tr = $api["Date" . $i] . " " . htmlspecialchars($api["Name" . $i],ENT_QUOTES);
echo "<option value='" . $tr . "'>" . $tr . "</option>\n";
}
// submit button reloads page with selected file info
echo "</select> <input type='submit' name='submit' value='Submit'>\n";
echo "</form>\n";
echo "<p>Files found: " . $count . "</p>\n";
}
?>
</body>
</html>
help php
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
-
- Posts: 2
- Joined: Mon Jun 21, 2010 2:06 pm
Re: help php
I'm having trouble, do not know php. Someone can complete the example with the ip and password I provided so I can test?
thanks
thanks
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: help php
It's pretty self-explanatory. The example shows this:
And you said your info was this:
http://187.44.16.178:8087/
password: 123456
So just replace the example info with yours:
Code: Select all
$url = "http://192.168.1.100:8087/api"; // <-- use your game server IP
$pw = "my_api_password"; // <-- use your api password
http://187.44.16.178:8087/
password: 123456
So just replace the example info with yours:
Code: Select all
$url = "http://187.44.16.178:8087/api";
$pw = "123456";