Brendonm96 Posted September 9, 2020 Share Posted September 9, 2020 (edited) 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 September 9, 2020 by Brendonm96 wrong format Quote Link to comment https://forums.phpfreaks.com/topic/311453-php-curl-issue-with-whmcs/ Share on other sites More sharing options...
requinix Posted September 9, 2020 Share Posted September 9, 2020 curlCall is some function defined somewhere in your application. Look at it to see how it is supposed to be called and then update your code accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/311453-php-curl-issue-with-whmcs/#findComment-1581253 Share on other sites More sharing options...
Phi11W Posted September 9, 2020 Share Posted September 9, 2020 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. Quote Link to comment https://forums.phpfreaks.com/topic/311453-php-curl-issue-with-whmcs/#findComment-1581254 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.