|
|||
|
cPanel/WHM API help
Hi,
I was just wondering, can you run a string in a function or does it has to be standalone. I'm using whmreq function. What I mean extactly is this: If I write my coding and at the end I add: $bob = $test->adding($host,$user,$accesshash); It runs adding and adds the package, like it suppose to do, but if I add that line in a function... nothin works. Please help, I'm in big need. Regards, Pat |
|
|||
|
The function doesn't have access to the variables $test, $host, $user, and $accesshash etc.
You can use the global keyword to get the vars from the global scope PHP Code:
or pass in the vars as arguments to the function: PHP Code:
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|