Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
scrooge_mcduck
13 Jan 11 22:56
Joined:
Date Joined: 24 Apr 08
| Topic/replies: 899 | Blogger: scrooge_mcduck's blog
Hi there I have the following bit of code included in a php login function:

$response = $betfairlibrary->betfair_global_api->betfair_api_login($username,$password,$productId, $softwareId);

Now when I call this login function in a bit of standalone php code it works fine but if I try and make this whole file a function to be called from another file it fails on this line within the login function. Does anyone know why this might be?

I still have a very basic knowledge of php tbh so I don't know whether I not aware of any particular rules surrounding objects/classses etc.

Thanks
Pause Switch to Standard View Betfair API help needed!
Show More
Loading...
Report Escapee January 15, 2011 12:40 PM GMT
It will be caused by the scope of the variables

Look at the line where it is failing and then look for where the variables on that line are declared and assigned values, its likely that they are out of scope when you move this function to a stand alone module.
Report scrooge_mcduck January 16, 2011 3:16 PM GMT
Thanks Escapee, turned out I just needed to load the Betfait API Framework outside this new function and all works well again!
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com