Hello, used the default form for decrement..
here the administrator decrement the users chips and save a log on a database..
but i need the player to write his password in the form or the code stop. any help ?
$curl_connection = curl_init('http://localhost:8087/api');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$post_data['Command'] = 'AccountsDecBalance';
$post_data['Player'] = "$user";
$post_data['Amount'] = "$chips";
$post_data['Password'] = 'apipass';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);
echo "$chips chips has been cashed out from $user <br> <a href=menu.php >Main Menu</a>";
?></center>
Cashout
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Cashout
I'm not sure I understand the question. It sounds like you want a player to request a cashout (and prove their identity) and then have a separate administrator run code that decrements that balance? If that's correct, you could write a separate program that puts up an html form for the player where they enter their name, password, amount. Process that with PHP so that it confirms the password (using the AccountsGet API) and then logs that request into some kind of database and possibly sends an email to the admin. The admin then comes along later and runs code that scans the database for pending requests and then processes them.mike123 wrote:Hello, used the default form for decrement..
here the administrator decrement the users chips and save a log on a database..
but i need the player to write his password in the form or the code stop. any help ?
Re: Cashout
u didnt understand me my english is bad. well just a simple question...
i want the api to verify a players password if its true in the poker mavens
for example..
lets say a form
player : mike
password : 123
the api go to mike. and check if the passwrod is 123. if yes continue if no die and echo wrong pass.. thats it.. thank you.
i want the api to verify a players password if its true in the poker mavens
for example..
lets say a form
player : mike
password : 123
the api go to mike. and check if the passwrod is 123. if yes continue if no die and echo wrong pass.. thats it.. thank you.
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Cashout
Just call AccountsGet in the API with a Player parameter set to the player's name and then compare $api["PW"] with the Password that the user entered on the form.mike123 wrote: i want the api to verify a players password if its true in the poker mavens
if ($api["PW"] <> $Password) die("Password is incorrect");
Re: Cashout
sorry for disturbing , my programmer is absent and i wanna do it myself.
just one question.
lets say in the pm server... there's the player tony
i want to echo that player's pass...
<?php
include "API.php";
$tonypass=?????? ;
echo "$tonypass";
?>
just this one will solve it . . . thank you again kent (:
just one question.
lets say in the pm server... there's the player tony
i want to echo that player's pass...
<?php
include "API.php";
$tonypass=?????? ;
echo "$tonypass";
?>
just this one will solve it . . . thank you again kent (:
-
- Site Admin
- Posts: 5880
- Joined: Wed Mar 19, 2008 8:47 pm
Re: Cashout
To make an API call, you've got to do all the curl parameter setup like you showed in your original message. Except instead of using the AccountsDecBalance command, you will use AccountsGet. Check the API docs in the help file for all the results returned by AccountsGet.mike123 wrote:sorry for disturbing , my programmer is absent and i wanna do it myself.
just one question.
lets say in the pm server... there's the player tony
i want to echo that player's pass...
Re: Cashout
Still not workin
<?php
include "API.php";
$curl_connection = curl_init('http://localhost:8087/api');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$post_data['Command'] = 'AccountsGet';
$post_data['Player'] = "mix";
$post_data['Password'] = 'apipass';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);
echo $api["PW"];
?>
<?php
include "API.php";
$curl_connection = curl_init('http://localhost:8087/api');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
$post_data['Command'] = 'AccountsGet';
$post_data['Player'] = "mix";
$post_data['Password'] = 'apipass';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
curl_close($curl_connection);
echo $api["PW"];
?>
Re: Cashout
Finally it works now . thank you for your help kent .