Code:
<?
class LibertyReserve {
require ('config.php');
public function sendMoney($amount, $currency=$DEFCurrency, $target, $memo) {
require('config.php');
$content = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9');
for ($i=0; $i!=$length;$i++){
$RandomString_Each = rand (0,61);
$RandomString .= $content[$RandomString_Each];
}
$rid = $RandomString;
$request = '
<TransferRequest id="' . $rid . '">
<Auth>
<ApiName>' . $APINAME . '</ApiName>
<Token>' . $auth . '</Token>
</Auth>
<Transfer>
<TransferType>transfer</TransferType>
<Payer>' . $LRAC . '</Payer>
<Payee>' . $target . '</Payee>
<CurrencyId>' . $currency . '</CurrencyId>
<Amount>' . $amount . '</Amount>
<Memo>' . $memo . '</Memo>
<Anonymous>false</Anonymous>
</Transfer>
</TransferRequest>
';
$url = 'https://api.libertyreserve.com/xml/transfer.aspx?req=' . $request;
$response = file_get_contents($url);
echo $response;
}
}
?>
Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting T_FUNCTION in C:\inetpub\wwwr oot\LRapi\class \LibertyReserve .class.php on line 3
Note: I am requiring 2 config.php, it is NOT a mistake, because i can't use var. in "sendMoney" if i require the file outside "sendMoney" function. And the another config.php have contain $DEFCurrency and $auth.
Comment