You most likely already know and / or have seen that old apache authentication system (htpasswd | image below).
Well,Ineedtocreateacodethatsendstheloginandpasswordtotheformandentersdirectonthepage.Noneedtomanuallyentereverything.
IknowthatitispossibletodothisinhtmlformsusingCURL,butinthatcaseIhavenoidea.
Note:Iwanttoperformloginautomatically,donotcreatethiswindow.IfanyonecanhelpIthank.
========================ExampleusingCURLandanHTMLform:
<?php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, 'http://www.sitecomsistemaauth.com/index.php');
curl_setopt ($curl, CURLOPT_POST, 1);
curl_setopt ($curl, CURLOPT_POSTFIELDS, 'meulogin=abc&senha=123');
curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($curl, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1;
// Variável que armazena o HTML renderizado após o login;
$sendPost = curl_exec ($curl);
// REGEX PARA PEGAR STRINGS DA PÁGINA
$pattern = '@(.*)@';
$target = $sendPost;
$matches = array();
$finalContent = $normalMode($pattern,$target,$matches);
// Retorna todos os resultados encontrado;
echo "<pre>";
var_dump($finalContent,$matches);
curl_close ($curl);
?>