help php

For general discussion of the Poker Mavens software
Post Reply
gringocode3
Posts: 2
Joined: Mon Jun 21, 2010 2:06 pm

help php

Post by gringocode3 »

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> &nbsp; <input type='submit' name='submit' value='Submit'>\n";
echo "</form>\n";
echo "<p>Files found: " . $count . "</p>\n";
}

?>
</body>
</html>
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: help php

Post by Kent Briggs »

The example here shows how to do that:

http://www.briggsoft.com/docs/pmavens/A ... #poker_api
gringocode3
Posts: 2
Joined: Mon Jun 21, 2010 2:06 pm

Re: help php

Post by gringocode3 »

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
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: help php

Post by Kent Briggs »

It's pretty self-explanatory. The example shows this:

Code: Select all

  
$url = "http://192.168.1.100:8087/api";     // <-- use your game server IP
$pw = "my_api_password";                    // <-- use your api password
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://187.44.16.178:8087/api";
$pw = "123456";
Post Reply