title: WHMCS API - Trying to post data from a html form
body: <p>I understand PHP pretty well however I have never had to deal with curl before today so I'm having a bit of an issue understanding how I am supposed to submit data to WHMCS API </p>
  
  <p>I have made a simple HTML form on my website but I'm trying to make the following code obtains the variables such as subject and message I have tried many different ways and I keep getting error 500 and I can't find a guide on the WHMCS forum there seems to be a few which might work however these topics have been removed as there old I'm guessing</p>
  
  <p>The following code is what WHMCS gives you to work with all I need is some help to understand how I format the variables coming from my form</p>
  
  <pre><code>&lt;?php 
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, '####'); 
  curl_setopt($ch, CURLOPT_POST, 1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
              'action' =&gt; 'OpenTicket',
              'username' =&gt; '#',
              'password' =&gt; '#',
              'accesskey' =&gt; '#',
              'deptid' =&gt; '1',
              'subject' =&gt; 'This is a sample ticket',            
              'message' =&gt; 'Demo Text',
              'email' =&gt; 'demo@demo.com',
              'name' =&gt; 'Demo User',
              'priority' =&gt; 'Medium',
              'markdown' =&gt; true,
              'responsetype' =&gt; 'json',
          ) ) ); 
  $response = curl_exec($ch); 
  curl_close($ch);
  ?&gt;`
  </code></pre>