Code: Select all
$account = $_POST['account'];
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
echo "Username: " . $api["Player"] . "</br>Balance: " . $api["Balance"] . " ";
Code: Select all
$account = $_POST['account'];
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
echo "Username: " . $api["Player"] . "</br>Balance: " . $api["Balance"] . " ";
Show us the function you wrote so we can see.PokerFreak wrote: It works. But when i try to put the code in a function no info is displayed. Any Help ?
Code: Select all
function playerInfo() {
$account = $_POST['account'];
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
echo "Username: " . $api["Player"] . "</br>Balance: " . $api["Balance"] . " ";
}
Code: Select all
<?php
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
if($api['PW'] != $pass) {
header("Location: cashout.php?flag=wrong");
}
else {
playerInfo();
$params = "Password=$pw&Command=AccountsDecBalance&Player=$account&Balance=$balance";
}
?>
Where are you placing the actual function? You didn't show it here.PokerFreak wrote: If I paste the content of the function in the "else { }" it works. But if I call it through a function, it doesn't.
PokerFreak wrote:Code: Select all
else { playerInfo(); $params = "Password=$pw&Command=AccountsDecBalance&Player=$account&Balance=$balance"; }
Also, what is the purpose of this line? It's not doing anything and it's not even a correct call for the AccountsDecBalance command anyway.PokerFreak wrote:Code: Select all
$params = "Password=$pw&Command=AccountsDecBalance&Player=$account&Balance=$balance";
Code: Select all
<html>
<?php include "API.php";
$pass = $_POST['pass'];
$account = $_POST['account'];
function playerInfo() {
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
echo "Username: " . $api["Player"] . "</br>Balance: " . $api["Balance"] . " ";
}
?>
<head>
<div align="left">
<h3><a href="12.php">Main</a></h3></div>
<center><img src="spades.jpg" alt="logo" width="150" height="150" /></center>
<?php echo "<br/><b>Your IP Address is $ip</b>"; ?>
</head>
<body>
<br/><br/><br/><br/><br/><br/><br/><br/>
<?php
$params = "Password=$pw&Command=AccountsGet&Player=$account";
$api = Poker_API($url,$params,true);
if($api['PW'] != $pass) {
header("Location: cashout.php?flag=wrong");
}
else {
playerInfo();
}
?>
</br></br></br>
<form method="post" name="auth" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<center>
<table width="400" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="50" align="right">Enter Balance </td>
<td><input name="balance" type="text" id="balance"></td>
</tr>
<tr>
<td width="150" align="right"> </td>
<td>
<input type="submit" name="Submit" value="Submit"></left></td>
</tr>
</center>
</table>
</form>
</body>
</html>