dwest100 Posted March 23, 2021 Share Posted March 23, 2021 (edited) Hi, I have this curl string required by an email verification vendor I use. Inside my php file I wish to run it. Apparently there is a problem with the syntax as I’m getting the following error in the browser: ”Parse error: syntax error, unexpected '--' (T_DEC) in /var/www/html/wp-content/plugins/dw_functionality_plugin/dw_functionality_plugin.phpon line 398 Here is the code string: < curl --request POST\ --url 'https://api.neverbounce.com/v4/single/check?key={' . api_key . '}&email={' . email . '}; > any help much appreciated! Edited March 23, 2021 by dwest100 Quote Link to comment https://forums.phpfreaks.com/topic/312363-curl-error-when-running-inside-php-code/ Share on other sites More sharing options...
gw1500se Posted March 23, 2021 Share Posted March 23, 2021 I have no idea what that is. Use the PHP cURL library. Quote Link to comment https://forums.phpfreaks.com/topic/312363-curl-error-when-running-inside-php-code/#findComment-1585308 Share on other sites More sharing options...
NotionCommotion Posted March 23, 2021 Share Posted March 23, 2021 2 hours ago, dwest100 said: Hi, I have this curl string required by an email verification vendor I use. Inside my php file I wish to run it. Apparently there is a problem with the syntax as I’m getting the following error in the browser: ”Parse error: syntax error, unexpected '--' (T_DEC) in /var/www/html/wp-content/plugins/dw_functionality_plugin/dw_functionality_plugin.phpon line 398 Here is the code string: < curl --request POST\ --url 'https://api.neverbounce.com/v4/single/check?key={' . api_key . '}&email={' . email . '}; > any help much appreciated! If you are truly trying to send ?key={' . api_key . '}&email={' . email . '}, that is your error, and you really want to send ?key=yourApiKey&email=theemail@bla.com; Quote Link to comment https://forums.phpfreaks.com/topic/312363-curl-error-when-running-inside-php-code/#findComment-1585314 Share on other sites More sharing options...
maxxd Posted March 24, 2021 Share Posted March 24, 2021 It looks like you're trying to combine cURL CLI and cURL php. They aren't interchangeable or compatible. Follow the link gw1500se gave you, then consider NotionCommon's advice. Quote Link to comment https://forums.phpfreaks.com/topic/312363-curl-error-when-running-inside-php-code/#findComment-1585323 Share on other sites More sharing options...
dwest100 Posted March 28, 2021 Author Share Posted March 28, 2021 Thanks much! Quote Link to comment https://forums.phpfreaks.com/topic/312363-curl-error-when-running-inside-php-code/#findComment-1585455 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.