I want a data from other website which url looks like "https://www.example.com/quote/results" after fill all data. I not understand how to pass data to get correct data.I try this code but it show only blank page.
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include('simple_html_dom.php');
$czip=$_POST['czip'];
$dest=$_POST['dest'];
$weight=$_POST['weight'];
$url = 'https://www.example.com/quote/results';
$data = array('collection-zip' =>$czip,
'destination'=>$dest,
'weight' =>$weight);
$ch = curl_init();
$timeout=5;
$ch = curl_init($url);
$data=http_build_query($data);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
echo "<pre>";
print_r($data);
exit;
if($headers['http_code'] == 200){
echo $content;
exit;
}
?>
I am not familiar with curl and web scrapping. if any soultion please share.