Я думаю, вам нужно инициализировать оба запроса curl двумя разными переменными.
function login($user, $pass, $account) {
$URL = 'https://example.com/index.php';
global $cookie_path;
$ch = curl_init($URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'url_login='.$user.'&url_password='.$pass.'&url_account='.$account);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_path);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
function get($url) {
global $cookie_path;
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $url);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch2, CURLOPT_COOKIEJAR, $cookie_path);
curl_setopt($ch2, CURLOPT_COOKIEFILE, $cookie_path);
$html = curl_exec($ch2);
curl_close($ch2);
return $html;
}
Надеюсь, это вам поможет.