-
<?
-
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;
-
}
-
}
-
?>
-
I got:
Parse error: syntax error, unexpected T_REQUIRE_ONCE, expecting T_FUNCTION in C:\inetpub\wwwroot\LRapi\class\LibertyReserve.clas s.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.
It's a syntax error. It's also pretty obvious.
You are attempting to require a file in a space that is reserved for the definition of member variables and methods. Move it to the outside of the class.
Also, instead of requiring the file again, why don't you just try using the global keyword to define the variables you need in your method's scope?
2 1935 kovik 1,044
Recognized Expert Top Contributor
It's a syntax error. It's also pretty obvious.
You are attempting to require a file in a space that is reserved for the definition of member variables and methods. Move it to the outside of the class.
Also, instead of requiring the file again, why don't you just try using the global keyword to define the variables you need in your method's scope?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Phil Powell |
last post by:
I traced the problem to what I believe is when I use the included
content library script into the viewinterns.php page. This script
will repeatedly instantiate a DateGroupHTMLGenerator class...
|
by: bmiras |
last post by:
I've got a problem using urllib2 to get a web page.
I'm going through a proxy using user/password authentification
and i'm trying to get a page asking for a HTTP authentification.
And I'm using...
|
by: Christian Eriksson |
last post by:
Hi!
I have a problem using the environment variable LD_LIBRARY_PATH in my
perl script. Everything works fine when I set it at the command prompt
and then runs my perl script like this:
...
|
by: Kent Lewandowski |
last post by:
hi all,
Recently I wrote some stored procedures using java jdbc code
(admittedly my first stab) and then tried to implement the same within
java packages (for code reuse). I encountered...
|
by: wadefleming |
last post by:
I have the following code which I am having trouble with. The problem
is detailed in the comments near the end.
Constants.cs:
--------------
namespace MyApp.Const
{
public class Const
{...
|
by: parseint |
last post by:
Hi,
Im trying to send a files using a HTTP POST request in my Window
Application. I also have a progressbar that is being updated whil
uploading. I have managed to send a file using HTTP PUT,...
|
by: muntyanu |
last post by:
Hi All,
I got permission issue when accesing network files from the application
that was started using Process component.
Actually I have my .NET windows service running. From this service I...
|
by: Wang E |
last post by:
I've been working on an online judge(for ACM/ICPC) using C#.Programmes
submitted by users can now be compiled,and it's the problem to judge.I
use the Process class in C#,and my thread is as...
|
by: Franky |
last post by:
Been having a problem using a treeview. Work great the first time the form
containing it is entered but not the second time.
Took a while to create a small sample that exhibits the problem, but...
|
by: prasenjit2007 |
last post by:
Hello,
can u help me sending Email with attachments using the Class phpMailer.
On the website I have a link to an html form in which I input the parameters with the names 1)from(textbox name)...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |