如何在php中使用curl?

I am trying to use cURL. I want to send a number via a POST request using cURL. response site: if number is wrong: response: "sorry number is wrong" if number is correct go other page html. I use the bellow code:

$number = "+98*******"; // enter a phone number
$data = array('phone' => $number);
$url = "https://example_page1/auth/login";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$res = curl_exec($ch);


echo "
" . substr($number, 0, -7) . "******* :" . $res; 
?> 

The above code works properly. when number is wrong: response:"*******: sorry.number is wrong"

when number is correct is give empty page . i want to go page 2 and give header ,... but give empty page. What is the problem؟