I am trying to automatically log in with Curl on this site: https://online.hinode.com.br, and the consultant ID must be filled in automatically, along with the status that will always be the same, after login should be redirected to a specific product page. However, the codes I tested did not go anywhere! No error, html does not load ... I think it should be this select field, I do not know.
Code:
<?php
// Start cURL
$ch = curl_init();
// Define the original URL (of the login form)
curl_setopt($ch, CURLOPT_URL, 'https://online.hinode.com.br/');
// Enable POST protocol
curl_setopt ($ch, CURLOPT_POST, 1);
// Define the parameters that will be sent (user and password for example)
curl_setopt ($ch, CURLOPT_POSTFIELDS, 'loja_consultor=fulano&estado=SP');
// Imitate the boss behavior of browsers: handle cookies
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
// Set the transfer type (Padrão: 1)
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute the requisition
$store = curl_exec ($ch);
// Define a new URL to be called (after login)
curl_setopt($ch, CURLOPT_URL, 'https://online.hinode.com.br/detalhes.asp?IdProduto=769&ssp=830852727SSP20171218HP115020');
// Execute the second request
$content = curl_exec ($ch);
// Close cURL curl_close ($ch);
Thanks in advance!