Jump to content

PHP cURL issue with WHMCS


Brendonm96

Recommended Posts

Hi All, 

Not sure if you could maybe help with basic PHP cURL coding... 

I have a module to get products from another site but I keep on getting the error code below:

Quote

> ArgumentCountError: Too few arguments to function curlCall(), 1 passed in /clientzone/modules/products.php on line 33 and at least 2 expected in /clientzone/includes/functions.php:0
Stack trace:
#0 /clientzone/modules/products.php(33): curlCall('http://url')
#1 /clientzone/modules/products.php(56): bright_getAllProducts()
#2 /clientzone//Module/AbstractModule.php(0): zadomainsssl_ConfigOptions(Array)
#3 /clientzone/lib/Module/Server.php(0): WHMCS\Module\AbstractModule->call('ConfigOptions', Array)
#4 /clientzone/configproducts.php(0): WHMCS\Module\Server->call('ConfigOptions', Array)
#5 {main}

The PHP code for the error above is:

function bright_getAllProducts() {
$productRequest = curlCall('http://url');
return $productRequest; 
}

Any idea why the above error is given and how I can resolve it?

Edited by Brendonm96
wrong format
Link to comment
Share on other sites

1 hour ago, Brendonm96 said:

ArgumentCountError: Too few arguments to function curlCall(), 1 passed in /clientzone/modules/products.php on line 33 and at least 2 expected in /clientzone/includes/functions.php:0

. . .

$productRequest = curlCall('http://url');

This is actually quite an informative error message:

"Too few arguments to function curlCall() ..." 
"... 1 passed in /clientzone/modules/products.php on line 33" 
"... at least 2 expected in /clientzone/includes/functions.php:0" 

You've defined a function curlCall that takes "at least 2" arguments . 
You're now calling that function with only 1 argument.  Bzzzt!!  PHP says "No". 

Regards, 
   Phill  W. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.