Jump to content

Curl error when running inside php code


dwest100
 Share

Recommended Posts

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 by dwest100
Link to comment
Share on other sites

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;

Link to comment
Share on other sites

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.

 Share

×
×
  • 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.