Page 1 of 1

API.php advice

Posted: Fri Feb 17, 2012 3:05 pm
by Bonza
Hi here is my problem im getting could be long winded but here we go

On a page im using the ChipLeader.php to include Top ten of the leader board

But im trying to also include the SysStats.php on the same page

Both using the same API.php file

But um getting a error below

Fatal error: Cannot redeclare poker_api() (previously declared in XXXXXXXXX/API.php:6) in XXXXXXXXXXXXXX\API.php on line 6

So my question is can you include 2 or more API.php on one page??

or how do i get around this problem i can post links if needed.

Thanks for reading

Re: API.php advice

Posted: Fri Feb 17, 2012 3:22 pm
by Kent Briggs
Bonza wrote: So my question is can you include 2 or more API.php on one page??
Just remove the duplicate includes for API.php in your code so that there is only one. It just contains the Poker_API function which can be called any number of times from different locations in your code.

Re: API.php advice

Posted: Fri Feb 17, 2012 3:53 pm
by Bonza
thanks got it sorted

Had to remove both include 'API.php' from both files and add <?php include 'API.php' ?> to the body of the web page, now both are working