You cannot directly simulate a click with CURL. You have to analyse the request (HTTP Headers) you send to the server, when you click on the button, with tools like Chrome DevTools. You can use it like this.
Once you know the request URL and the parameters (if they exist), you can build a CURL request and get the response like this:
$ch = curl_init();
// params example
$post = [
'username' => 'user1',
'password' => 'pass1'
];
// Request URL
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
// server response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_response = curl_exec ($ch);
curl_close ($ch);