Forums

General Betting

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

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 2
By:
Escapee
When: 15 Jan 11 12:40
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.
By:
scrooge_mcduck
When: 16 Jan 11 15:16
Thanks Escapee, turned out I just needed to load the Betfait API Framework outside this new function and all works well again!
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com