0

I'm not seeing what the problem is here.

PHP Parse error: syntax error, unexpected '$curl' (T_VARIABLE)

$file = 'https://www.somesite.com/conversion.jpg?id=blahblah&name='.$xmlval['fname'].'&city='.$xmlval['city'].'&state='.$xmlval['regionDisplay'].'&email='.$xmlval['email'].'&message='.($xmlval['rebill'] == 'true' ? 'Renewed ' : 'Purchased ').$spc_licenses.($spc_licenses == 1 ? ' license ' : ' licenses ').' of product!';

if (function_exists('curl_version')) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $file);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $content = curl_exec($curl);
    curl_close($curl);
}
else if (file_get_contents(__FILE__) && ini_get('allow_url_fopen'))
{
    $content = file_get_contents($file);
}
else
{
    echo 'error';  /* neither available */
}
user756659
  • 3,372
  • 13
  • 55
  • 110

1 Answers1

0

your code is fine, but check one in phpini that your curl is enabled or not extension=php_curl.dll this is the enabled state and ;extension=php_curl.dll is the disabled state.

Nivedita
  • 164
  • 1
  • 10